diff --git a/app.py b/app.py index cf3553c..a8c90d9 100644 --- a/app.py +++ b/app.py @@ -1,7 +1,6 @@ import datetime import hashlib import os -# import imageio from PIL import Image from flask import Flask, render_template, redirect, url_for, request, jsonify @@ -16,6 +15,8 @@ from utils import anonymous_required # Create a new Flask instance app = Flask(__name__) app.secret_key = 'PSSSSSHHHT!' +UPLOAD_FOLDER = 'static/profile_images/' # Folder to store profile images +app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER # Initialize the Flask-Login extension login_manager = LoginManager() @@ -244,7 +245,7 @@ def habit_create(): unit = 1 # Save habit to database - habit = Habit.create(list_id, name, times, note, unit) + Habit.create(list_id, name, times, note, unit) # Back to index return redirect(url_for('index')) @@ -271,7 +272,7 @@ def habit_list_create(): if not name: errors['name'] = 'Der Name ist erforderlich.' if not description: - note = '' + description = '' if errors: return render_template( @@ -283,7 +284,7 @@ def habit_list_create(): ) # Save habit to database - habit = HabitList.create(current_user.id, name, description) + HabitList.create(current_user.id, name, description) # Back to index return redirect(url_for('index')) @@ -387,7 +388,7 @@ def edit_habit_change(): # check if list_id is an int try: - list_id = int(list_id) + int(list_id) except ValueError: errors['list_query'] = 'Die Anzahl muss eine Zahl sein.' @@ -466,9 +467,6 @@ def password_change(): def save_profile_image(image_file): - UPLOAD_FOLDER = 'static/profile_images/' # Folder to store profile images - app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER - filename = image_file.filename if '.' not in filename: # Ensure the filename has an extension diff --git a/models/User.py b/models/User.py index a736136..8f8f03f 100644 --- a/models/User.py +++ b/models/User.py @@ -65,7 +65,7 @@ class User(UserMixin): def get_heatmap(self) -> tuple: # get current day of week as integer. monday is 0 and sunday is 6 weekday = datetime.today().weekday() - heatmap = [] + heatmap = [100] # append the heatmap values of the current week for day in range(0, weekday): diff --git a/templates/components/habit_lists.html b/templates/components/habit_lists.html index 76f6de7..b8c16c9 100644 --- a/templates/components/habit_lists.html +++ b/templates/components/habit_lists.html @@ -103,9 +103,7 @@
{% else %} diff --git a/templates/users.html b/templates/users.html index e17ee21..fb6d1d9 100644 --- a/templates/users.html +++ b/templates/users.html @@ -16,7 +16,9 @@ - +