Compare commits

..

No commits in common. "09a2a6ac5f31a3dc139f7f522075f57033538309" and "d4652873162c2f66dbf4f7b4f0df4862d857593b" have entirely different histories.

9
app.py
View File

@ -396,6 +396,7 @@ def edit_habit():
@login_required @login_required
def edit_habit_change(): def edit_habit_change():
units = ["Tag", "Woche", "Monat", "Jahr"] units = ["Tag", "Woche", "Monat", "Jahr"]
name = request.form.get('name') name = request.form.get('name')
note = request.form.get('note') note = request.form.get('note')
@ -529,8 +530,6 @@ def save_profile_image(image_file):
# Get the filename from the image path saved in the user # Get the filename from the image path saved in the user
filename = os.path.basename(current_user.profile_image) filename = os.path.basename(current_user.profile_image)
image_path = os.path.join(app.config['UPLOAD_FOLDER'], filename)
os.remove(image_path)
# Check if the image is an animated gif # Check if the image is an animated gif
if file_extension == 'gif': if file_extension == 'gif':
@ -567,7 +566,8 @@ def save_profile_image(image_file):
def save_profile_animated(image_file, filename): def save_profile_animated(image_file, filename):
# Save the GIF temporarily # Save the GIF temporarily
gif_path = os.path.join(app.config['UPLOAD_FOLDER'], filename.replace(".jpg", ".gif")) filename = filename.replace(".jpg", ".gif")
gif_path = os.path.join(app.config['UPLOAD_FOLDER'], filename)
image_file.save(gif_path) image_file.save(gif_path)
current_user.profile_image = gif_path current_user.profile_image = gif_path
@ -718,7 +718,6 @@ def users():
errors={}, errors={},
) )
@app.route('/users-edit') @app.route('/users-edit')
@login_required @login_required
def edit_users(): def edit_users():
@ -858,7 +857,6 @@ def user_leave():
habit_list.remove_user(current_user.id) habit_list.remove_user(current_user.id)
return redirect(url_for("index")) return redirect(url_for("index"))
@app.route('/accept-list', methods=['POST']) @app.route('/accept-list', methods=['POST'])
@login_required @login_required
def accept_list(): def accept_list():
@ -879,7 +877,6 @@ def accept_list():
current_user.accept_List(habit_list.id) current_user.accept_List(habit_list.id)
return {} return {}
@app.route('/deny-list', methods=['POST']) @app.route('/deny-list', methods=['POST'])
@login_required @login_required
def deny_list(): def deny_list():