From 3e6e51e308f8193ea05c12dd86172c525de6231a Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sat, 21 Jun 2014 02:22:35 +0000 Subject: [PATCH] Small fixes --- rophako/model/photo.py | 4 ++-- rophako/modules/photo.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rophako/model/photo.py b/rophako/model/photo.py index b1edfbf..cf523f6 100644 --- a/rophako/model/photo.py +++ b/rophako/model/photo.py @@ -295,7 +295,7 @@ def upload_from_pc(request): form = request.form count = 0 status = None - for upload in request.files.getlist("file"): + for upload in reversed(request.files.getlist("file")): count += 1 # Make a temp filename for it. @@ -553,4 +553,4 @@ def random_hash(): """Get a short random hash to use as the base name for a photo.""" md5 = hashlib.md5() md5.update(str(random.randint(0, 1000000)).encode("utf-8")) - return md5.hexdigest()[:8] \ No newline at end of file + return md5.hexdigest()[:8] diff --git a/rophako/modules/photo.py b/rophako/modules/photo.py index 6a6c0f7..32d6c04 100644 --- a/rophako/modules/photo.py +++ b/rophako/modules/photo.py @@ -100,7 +100,7 @@ def upload(): # Good! if is_ajax: # Was it a multiple upload? - if result["multi"]: + if result.get("multi"): return ajax_response(True, url_for(".album_index", name=album)) else: return ajax_response(True, url_for(".crop", photo=result["photo"])) @@ -262,4 +262,4 @@ def arrange_photos(album): g.info["album"] = album g.info["photos"] = photos - return template("photos/arrange_photos.html") \ No newline at end of file + return template("photos/arrange_photos.html")