Created
June 1, 2012 01:25
-
-
Save qoelet/2847884 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting a GET value | |
pageNumber = int(request.GET.get('page', 1)) | |
# But some doofus goes and change /?page=n, n to some weird char and ValueError | |
# Fixed | |
try: | |
pageNumber = int(request.GET.get('page', 1)) | |
except ValueError: | |
pageNumber = 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment