diff --git a/gallery/__init__.py b/gallery/__init__.py index ccb3cec..501afd9 100644 --- a/gallery/__init__.py +++ b/gallery/__init__.py @@ -5,7 +5,7 @@ | |_| | | | | | |_| | |__| __/ (_| \__ \ \___/|_| |_|_|\__, |_____\___|\__, |___/ |___/ |___/ -Created by Fluffy Bean - Version 23.03.04 +Created by Fluffy Bean - Version 23.03.09 """ # Import system modules diff --git a/gallery/routing.py b/gallery/routing.py index 02b9f11..693ac17 100644 --- a/gallery/routing.py +++ b/gallery/routing.py @@ -41,12 +41,13 @@ def image(image_id): Image view, shows the image and its metadata """ img = db_session.query(db.Posts).filter(db.Posts.id == image_id).first() - author = db_session.query(db.Users.username).filter(db.Users.id == img.author_id).first()[0] - img.author_username = author - + if img is None: abort(404, 'Image not found') + author = db_session.query(db.Users.username).filter(db.Users.id == img.author_id).first()[0] + img.author_username = author + return render_template('image.html', image=img, exif=img.image_exif) @blueprint.route('/group', methods=['GET', 'POST']) diff --git a/gallery/templates/error.html b/gallery/templates/error.html index 0d63473..72b570e 100644 --- a/gallery/templates/error.html +++ b/gallery/templates/error.html @@ -1,7 +1,8 @@ {% extends 'layout.html' %} -{% block wrapper_class %}error-wrapper{% endblock %} {% block content %} -

{{error}}

-

{{msg}}

+ +

{{error}}

+

{{msg}}

+
{% endblock %} \ No newline at end of file diff --git a/gallery/templates/group.html b/gallery/templates/group.html index 3503fd1..af7f60c 100644 --- a/gallery/templates/group.html +++ b/gallery/templates/group.html @@ -1,29 +1,27 @@ {% extends 'layout.html' %} -{% block header %} +{% block nav_groups %}navigation-item__selected{% endblock %} + +{% block content %}