Created
March 12, 2016 13:22
-
-
Save m-bo-one/7b531e60e45b311512be to your computer and use it in GitHub Desktop.
This file contains 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
def username_for_change(change): | |
author = change.author | |
username = 'noname' | |
try: | |
if author: | |
username = author.username or 'noname' | |
except ObjectDoesNotExist: | |
pass | |
return username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment