#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

View File

@ -83,7 +83,9 @@ class Explorer(models.Model):
) )
def get_places_eligible_to_see(self): 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): def is_eligible_to_see(self, place):
return ( return (