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

Avoid internal server error when user ids are string #4377

Merged
merged 2 commits into from
Dec 4, 2018

Conversation

jwkaltz
Copy link
Member

@jwkaltz jwkaltz commented Dec 3, 2018

No description provided.

@jwkaltz jwkaltz requested a review from sbrunner December 3, 2018 16:30
@@ -1549,7 +1549,7 @@ def logout(self):
log.info("Logout on non login user.")
raise HTTPBadRequest("See server logs for details")

log.info(u"User '{0!s}' ({1:d}) logging out.".format(
log.info(u"User '{0!s}' ({1:s}) logging out.".format(
Copy link
Member

Choose a reason for hiding this comment

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

Simply:

Suggested change
log.info(u"User '{0!s}' ({1:s}) logging out.".format(
log.info(u"User '{}' ({}) logging out.".format(

Copy link
Member Author

Choose a reason for hiding this comment

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

OK I simplified it like you suggested, thanks for the review.
By the way, I tested that logout works after this change when user id is not a number (tested on gr_webmap). This seems to be the only place in the code that assumes that user id is a number.

I will squash and merge.

@jwkaltz jwkaltz merged commit 09fc819 into 2.2 Dec 4, 2018
@jwkaltz jwkaltz deleted the gmf22_user_id_may_be_string branch December 4, 2018 12:30
@sbrunner sbrunner added this to the 2.2 milestone Jan 8, 2019
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