Skip to content

Commit

Permalink
Move 413 error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbates committed Mar 11, 2024
1 parent d4fd38a commit 449dc7f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
def not_found_error(error):
return render_template('404.html'), 404

@app.errorhandler(413)
def photo_too_large(error):
return "The attached photo is too large.", 413

@app.errorhandler(500)
def internal_error(error):
db.session.rollback()
Expand Down
4 changes: 0 additions & 4 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def before_request():
current_user.last_time = datetime.utcnow()
db.session.commit()

@app.errorhandler(413)
def photo_too_large(e):
return "The attached photo is too large.", 413

@app.context_processor
def inject_dynrootmargin():
dynrootmargin = app.config['DYNAMIC_ROOT_MARGIN']
Expand Down
2 changes: 1 addition & 1 deletion app/static/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.home-active:hover {
background: linear-gradient(to bottom, rgb(26, 26, 26) calc(100% - 2px), #ffffff 5px) no-repeat left bottom !important;
}
.mt-tamari {display: block !important;}
.mt-tam {display: block !important;}

/* RESPONSIVE */
@media screen and (max-width: 1000px) {
Expand Down
1 change: 1 addition & 0 deletions app/templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ <h1 class="mt-lists">Shopping Lists</h1>
<h1 class="mt-mealplanner">Meal Planner</h1>
<h1 class="mt-about">About</h1>
<h1 class="mt-myaccount">My Account</h1>
<h1 class="mt-tam">Tamari</h1>
{% else %}
<h1 class="mt-tamari">Tamari</h1>
{% endif %}
Expand Down

0 comments on commit 449dc7f

Please sign in to comment.