0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Remove redundant if statement and refactor checking condition

This commit is contained in:
Ann Paul 2015-10-02 09:27:39 -07:00
parent e955f7da4c
commit 17d97c17a1

View File

@ -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'