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

Bugfix/Fix NoReverseMatch on demo page for superuser #160

Merged

Conversation

@c-w
Copy link
Member

c-w commented Apr 14, 2019

Currently if a superuser accesses any of the demo pages, the Django server crashes with a NoReverseMatch as shown in the screenshot below:

Screenshot showing NoReverseMatch crash

This is caused by the fact that the demo pages re-use the annotation base template. When the user is a superuser, the annotation base template includes a link to edit the current project id. However, demo
projects don't have an id which causes the crash. This change fixes the crash by only including the project edit link if the Django context contains a project id.

Currently if a superuser accesses any of the demo pages, the Django
server crashes with a NoReverseMatch as shown in the screenshot below:

![Screenshot showing NoReverseMatch crash](https://user-images.githubusercontent.com/1086421/56097854-a5857300-5ec7-11e9-9782-a0274d01a1ac.png)

This is caused by the fact that the demo pages re-use the annotation
base template. When the user is a superuser, the annotation base
template includes a link to edit the current project id. However, demo
projects don't have an id which causes the crash. This change fixes the
crash by only including the project edit link if the Django context
contains a project id.
@Hironsan Hironsan merged commit e652289 into doccano:master Apr 15, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@c-w c-w deleted the CatalystCode:bugfix/fix-demo-pages-for-superuser branch May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.