Skip to content
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

Fixed #25299 -- Fixed crash with ModelAdmin.list_display value that clashes with a model reverse accessor. #5185

Merged
merged 1 commit into from Aug 28, 2015

Conversation

timgraham
Copy link
Member

@timgraham
Copy link
Member Author

@PirosB3 Hi Dan, this seems to be a regression due to the meta API changes. Maybe you could review the patch?

@PirosB3
Copy link
Contributor

PirosB3 commented Aug 27, 2015

Sure! will do that now

2015-08-26 19:17 GMT+02:00 Tim Graham notifications@github.com:

@PirosB3 https://github.com/PirosB3 Hi Dan, this seems to be a
regression due to the meta API changes. Maybe you could review the patch?


Reply to this email directly or view it on GitHub
#5185 (comment).


PirosB3

https://github.com/PirosB3

"""
field = opts.get_field(name)
if field.is_relation and field.many_to_one and not field.related_model:
Copy link
Contributor

Choose a reason for hiding this comment

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

@timgraham The changes look perfect. I was wondering, isn't is_relation a bit redundant in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, you did write that original code. 😛
I guess it could be related to the docs that say, "These attribute (field.many_to_one, etc.) are present on all fields; however, they will only have boolean values (rather than None) if the field is a relation type (Field.is_relation=True)." It seems we use a similar pattern of checking is_relation before the field flags elsewhere, so I think it's okay.

@PirosB3
Copy link
Contributor

PirosB3 commented Aug 28, 2015

Looks perfect to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants