#42 Place submitter and super users should be able to see a place

This commit is contained in:
reverend 2021-10-01 23:44:46 +02:00
parent 3f4bf9475c
commit 84b01f3a9a

View File

@ -86,7 +86,11 @@ class Explorer(models.Model):
return Place.objects.all().filter(level__lte=self.level)
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):
return self.user.username