Skip to content

Only warn if a field doesn't exist on the Django model #862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2020

Conversation

jkimbo
Copy link
Member

@jkimbo jkimbo commented Jan 29, 2020

Also don't warn if the field name matches a custom field.

Resolves issues from #842

Also don't warn if the field name matches a custom field.
@zbyte64
Copy link
Collaborator

zbyte64 commented Jan 31, 2020

I understand not having a warning or error for custom fields. But I am less clear on the reasoning for not raising an exception for when there is no attribute on the model. Might be useful to state the consequence of each warning in the warning. For instance, "Field name .* exists on Django model .* but it's not a model field" - does this mean my fields wont be read? If there isn't a real consequence then I would drop the warning and embrace the feature.

@jkimbo
Copy link
Member Author

jkimbo commented Jan 31, 2020

@zbyte64 the discussion is here: #842 . IMO switching to a warning rather than an exception is just to make the migration path a bit less severe for people. Good point about adding the consequence for each warning 👍 I'll update the messages.

@jkimbo
Copy link
Member Author

jkimbo commented Jan 31, 2020

@zbyte64 I've expanded the error messages to be more descriptive.

Copy link
Collaborator

@zbyte64 zbyte64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jkimbo jkimbo merged commit 280b38f into master Feb 7, 2020
@jkimbo jkimbo deleted the downgrade-validations branch February 7, 2020 09:55
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 1, 2020
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 3, 2020
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 3, 2020
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 3, 2020
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 3, 2020
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 3, 2020
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 5, 2020
a-rmz added a commit to City-of-Helsinki/berth-reservations that referenced this pull request Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants