#42 Place submitter and super users should be able to see a place
This commit is contained in:
parent
3f4bf9475c
commit
84b01f3a9a
@ -86,7 +86,11 @@ class Explorer(models.Model):
|
|||||||
return Place.objects.all().filter(level__lte=self.level)
|
return Place.objects.all().filter(level__lte=self.level)
|
||||||
|
|
||||||
def is_eligible_to_see(self, place):
|
def is_eligible_to_see(self, place):
|
||||||
return place in self.get_places_eligible_to_see()
|
return (
|
||||||
|
self.user.is_superuser or
|
||||||
|
place.submitted_by == self or
|
||||||
|
place in self.get_places_eligible_to_see()
|
||||||
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.user.username
|
return self.user.username
|
||||||
|
Loading…
Reference in New Issue
Block a user