Skip to content

Commit

Permalink
update python to 3.12 and bug fix for editing existing schedule.
Browse files Browse the repository at this point in the history
  • Loading branch information
William Hahn committed Nov 24, 2023
1 parent 278e1d8 commit 9d761a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM python:3.11-alpine
FROM python:3.12-alpine

WORKDIR /app

Expand Down
6 changes: 4 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ def update():
format = '%Y-%m-%d'

if request.method == 'POST':
current = Schedule.query.filter_by(id=request.form['id']).first()
existing = Schedule.query.filter_by(name=request.form['name']).first()
if existing:
flash("Schedule already exists")
return redirect(url_for('main.schedule'))
if current.name != request.form['name']:
flash("Schedule name already exists")
return redirect(url_for('main.schedule'))
my_data = Schedule.query.get(request.form.get('id'))
my_data.name = request.form['name']
my_data.amount = request.form['amount']
Expand Down

0 comments on commit 9d761a3

Please sign in to comment.