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

Link dialog sometimes won't open in admin interface #1351

Closed
athalean opened this issue Jul 13, 2015 · 3 comments
Closed

Link dialog sometimes won't open in admin interface #1351

athalean opened this issue Jul 13, 2015 · 3 comments

Comments

@athalean
Copy link

In some situations, trying to open /displayable_links.js generates a 500 with the following message:

TypeError at /displayable_links.js - unorderable types: dict() < dict()

https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/views.py#L197

Replacing this line with e.g. return HttpResponse(dumps([link[1] for link in sorted(links, key=lambda link: link[1]['title'])])) fixes the problem.

I'm using Python 3.4, but this line of code looks unintended and shouldn't work on Python 2 either :-)

@AlexHill
Copy link
Collaborator

Thanks for the report. In order to match the function's comment I've made the sort key (link[0], link[1]['value']).

@AlexHill
Copy link
Collaborator

BTW it does "work" on Python 2 in the sense that no exception is raised, but I'm guessing the semantics are undefined given that this was removed in Python 3.

@stephenmcd
Copy link
Owner

Fixed in #1352

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

No branches or pull requests

3 participants