parent
a4c0b31fc9
commit
7a49dcba99
1 changed files with 3 additions and 1 deletions
|
@ -142,11 +142,13 @@ class UserMaps(DetailView, PaginatorMixin):
|
||||||
owner = self.request.user == self.object
|
owner = self.request.user == self.object
|
||||||
manager = Map.objects if owner else Map.public
|
manager = Map.objects if owner else Map.public
|
||||||
maps = manager.filter(Q(owner=self.object) | Q(editors=self.object))
|
maps = manager.filter(Q(owner=self.object) | Q(editors=self.object))
|
||||||
maps = maps.distinct().order_by('-modified_at')[:50]
|
|
||||||
if owner:
|
if owner:
|
||||||
per_page = settings.UMAP_MAPS_PER_PAGE_OWNER
|
per_page = settings.UMAP_MAPS_PER_PAGE_OWNER
|
||||||
|
limit = 100
|
||||||
else:
|
else:
|
||||||
per_page = settings.UMAP_MAPS_PER_PAGE
|
per_page = settings.UMAP_MAPS_PER_PAGE
|
||||||
|
limit = 50
|
||||||
|
maps = maps.distinct().order_by('-modified_at')[:limit]
|
||||||
maps = self.paginate(maps, per_page)
|
maps = self.paginate(maps, per_page)
|
||||||
kwargs.update({
|
kwargs.update({
|
||||||
"maps": maps
|
"maps": maps
|
||||||
|
|
Loading…
Reference in a new issue