Skip to content

Commit 0894f68

Browse files
authored
Fix nomination visibility bug again (#1595)
Sometimes self.nominee can be null
1 parent 7f4da4d commit 0894f68

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nominations/models.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,13 @@ def visible(self, user=None):
227227
if user is None:
228228
return False
229229

230-
if user.is_staff or user == self.nominee.user or user == self.nominator:
230+
if user.is_staff:
231+
return True
232+
233+
if user == self.nominator:
234+
return True
235+
236+
if self.nominee and user == self.nominee.user:
231237
return True
232238

233239
return False

0 commit comments

Comments
 (0)