mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-29 17:36:49 +01:00
Remove redundant if statement and refactor checking condition
This commit is contained in:
parent
e955f7da4c
commit
17d97c17a1
@ -51,9 +51,8 @@ def index(request):
|
||||
if 'ordering' in request.GET:
|
||||
ordering = request.GET['ordering']
|
||||
|
||||
if ordering in ['name', 'username']:
|
||||
if ordering != 'name':
|
||||
users = users.order_by(ordering)
|
||||
if ordering == 'username':
|
||||
users = users.order_by(ordering)
|
||||
else:
|
||||
ordering = 'name'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user