do not fail on checking for submitter when user hashes get disabled

This commit is contained in:
Frédéric Péters 2012-11-11 19:00:54 +01:00 committed by Thomas NOEL
parent 13351720fb
commit b9d4b1e59e
1 changed files with 5 additions and 2 deletions

View File

@ -314,8 +314,11 @@ class FormData(StorableObject):
def is_submitter(self, user):
if self.user_id and str(self.user_id) == str(user.id):
return True
if self.user_hash and self.user_hash == user.hash:
return True
try:
if self.user_hash and self.user_hash == user.hash:
return True
except AttributeError:
return False
return False
# don't pickle _formdef cache