Simple code cleanups.
This commit is contained in:
@@ -10,9 +10,6 @@ from django.http import HttpResponseNotFound
|
||||
from django.conf import settings
|
||||
from django.utils.http import urlencode
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth import (authenticate,
|
||||
login,
|
||||
logout)
|
||||
from django.shortcuts import (render,
|
||||
redirect)
|
||||
|
||||
@@ -31,6 +28,7 @@ IMAGES_PER_PAGE = CELLS_PER_ROW * ROWS_PER_PAGE
|
||||
# Helper functions. #
|
||||
###########################################################################################
|
||||
|
||||
|
||||
def do_recursive_search(start_path, query):
|
||||
"""
|
||||
Gets all images and sub-directories inside the start_path whose name matches the given query,
|
||||
@@ -57,10 +55,12 @@ def do_recursive_search(start_path, query):
|
||||
# View functions. #
|
||||
###########################################################################################
|
||||
|
||||
|
||||
@login_required
|
||||
def index(request):
|
||||
return redirect('gallery_view_root')
|
||||
|
||||
|
||||
@login_required
|
||||
def gallery_view(request, path = None):
|
||||
"""
|
||||
@@ -80,7 +80,7 @@ def gallery_view(request, path = None):
|
||||
for c in range(cells):
|
||||
try:
|
||||
row.append(lst[i + c])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
rows.append(row)
|
||||
i += cells
|
||||
|
||||
Reference in New Issue
Block a user