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
|
||||
'''
|
||||
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,
|
||||
mode='live'
|
||||
) | Place.objects.filter(
|
||||
submitted_by=self,
|
||||
mode='live'
|
||||
)
|
||||
)).order_by('submitted_when')
|
||||
|
||||
def get_places_eligible_to_see(self):
|
||||
if self.user.is_superuser:
|
||||
@ -110,6 +110,12 @@ class Explorer(models.Model):
|
||||
place in self.get_places_eligible_to_see()
|
||||
)
|
||||
|
||||
def get_drafts(self):
|
||||
return Place.objects.filter(
|
||||
submitted_by=self,
|
||||
mode='draft'
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.user.username
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user