Fixing warning when testing (unordered list in pagination)
This commit is contained in:
parent
bc0ace7bf3
commit
e60a6ea9be
@ -88,15 +88,15 @@ class Explorer(models.Model):
|
|||||||
and the list views
|
and the list views
|
||||||
'''
|
'''
|
||||||
if self.user.is_superuser:
|
if self.user.is_superuser:
|
||||||
return Place.objects.filter(mode='live')
|
return Place.objects.filter(mode='live').order_by('submitted_when')
|
||||||
|
|
||||||
return Place.objects.filter(
|
return (Place.objects.filter(
|
||||||
level__lte=self.level,
|
level__lte=self.level,
|
||||||
mode='live'
|
mode='live'
|
||||||
) | Place.objects.filter(
|
) | Place.objects.filter(
|
||||||
submitted_by=self,
|
submitted_by=self,
|
||||||
mode='live'
|
mode='live'
|
||||||
)
|
)).order_by('submitted_when')
|
||||||
|
|
||||||
def get_places_eligible_to_see(self):
|
def get_places_eligible_to_see(self):
|
||||||
if self.user.is_superuser:
|
if self.user.is_superuser:
|
||||||
@ -110,6 +110,12 @@ class Explorer(models.Model):
|
|||||||
place in self.get_places_eligible_to_see()
|
place in self.get_places_eligible_to_see()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_drafts(self):
|
||||||
|
return Place.objects.filter(
|
||||||
|
submitted_by=self,
|
||||||
|
mode='draft'
|
||||||
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.user.username
|
return self.user.username
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user