Skip to content

Commit ccf0905

Browse files
authored
Merge pull request #6680 from readthedocs/sort-project-list
Add ability to sort dashboard by modified date
2 parents 09c6450 + e166c1c commit ccf0905

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

readthedocs/projects/views/private.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ def validate_primary_email(self, user):
112112
notification.send()
113113

114114
def get_queryset(self):
115-
return Project.objects.dashboard(self.request.user)
115+
sort = self.request.GET.get('sort')
116+
if sort not in ['modified_date', '-modified_date', 'slug', '-slug']:
117+
sort = 'slug'
118+
return Project.objects.dashboard(self.request.user).order_by(sort)
116119

117120
def get(self, request, *args, **kwargs):
118121
self.validate_primary_email(request.user)

0 commit comments

Comments
 (0)