Fixed attribute error if anonymous opens application/assignment view.
This commit is contained in:
parent
4cd1ad5954
commit
9f9ea81fc6
@ -164,7 +164,10 @@ class Application(models.Model, SlideMixin):
|
|||||||
yield object.person
|
yield object.person
|
||||||
|
|
||||||
def is_supporter(self, person):
|
def is_supporter(self, person):
|
||||||
|
try:
|
||||||
return self.applicationsupporter_set.filter(person=person).exists()
|
return self.applicationsupporter_set.filter(person=person).exists()
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def enough_supporters(self):
|
def enough_supporters(self):
|
||||||
|
@ -122,8 +122,11 @@ class Assignment(models.Model, SlideMixin):
|
|||||||
"""
|
"""
|
||||||
return True, if person is a candidate.
|
return True, if person is a candidate.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
return self.assignment_candidats.filter(person=person) \
|
return self.assignment_candidats.filter(person=person) \
|
||||||
.exclude(blocked=True).exists()
|
.exclude(blocked=True).exists()
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
def is_blocked(self, person):
|
def is_blocked(self, person):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user