#42 Fined tuned list of eligible to see places

This commit is contained in:
reverend 2021-10-02 00:03:45 +02:00
parent 84b01f3a9a
commit e11151858b
1 changed files with 3 additions and 1 deletions

View File

@ -83,7 +83,9 @@ class Explorer(models.Model):
)
def get_places_eligible_to_see(self):
return Place.objects.all().filter(level__lte=self.level)
if self.user.is_superuser:
return Place.objects.all()
return Place.objects.all().filter(level__lte=self.level) | self.places.all()
def is_eligible_to_see(self, place):
return (