MIGRATE: Implemented user color setting.
This commit is contained in:
parent
ce68bc9786
commit
8947c6d54c
9
app.py
9
app.py
@ -383,7 +383,6 @@ 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')
|
||||||
@ -517,6 +516,8 @@ 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':
|
||||||
@ -553,8 +554,7 @@ 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
|
||||||
filename = filename.replace(".jpg", ".gif")
|
gif_path = os.path.join(app.config['UPLOAD_FOLDER'], 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
|
||||||
@ -705,6 +705,7 @@ def users():
|
|||||||
errors={},
|
errors={},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/users-edit')
|
@app.route('/users-edit')
|
||||||
@login_required
|
@login_required
|
||||||
def edit_users():
|
def edit_users():
|
||||||
@ -844,6 +845,7 @@ 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():
|
||||||
@ -864,6 +866,7 @@ def accept_list():
|
|||||||
current_user.accept_List(list_id)
|
current_user.accept_List(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():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user