Merge branch 'master' of https://repo.cimeyclust.com/CimeyClust/HabitTracker
This commit is contained in:
commit
5251a80d02
8
app.py
8
app.py
@ -645,13 +645,7 @@ def delete_user_from_list():
|
|||||||
id = int(habit_user_id)
|
id = int(habit_user_id)
|
||||||
habit_list.delete(id)
|
habit_list.delete(id)
|
||||||
|
|
||||||
return render_template(
|
return redirect(url_for('index', habit_list=habit_list.id))
|
||||||
'users-edit.html',
|
|
||||||
title='Teilnehmer bearbeiten',
|
|
||||||
habit_list=habit_list,
|
|
||||||
users=users,
|
|
||||||
errors={},
|
|
||||||
)
|
|
||||||
|
|
||||||
@app.route('/users-leave')
|
@app.route('/users-leave')
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
@ -324,7 +324,7 @@ def habitList_update_slot(id: int, slot: int):
|
|||||||
|
|
||||||
|
|
||||||
def get_habitLists(user_id: int):
|
def get_habitLists(user_id: int):
|
||||||
query = (f"SELECT habit_lists.*, habit_users.user_id, habit_users.accepted FROM habit_lists JOIN habit_users ON habit_lists.id = habit_users.list_id "
|
query = (f"SELECT habit_lists.*, habit_users.accepted FROM habit_lists JOIN habit_users ON habit_lists.id = habit_users.list_id "
|
||||||
f"WHERE habit_users.user_id = {user_id};")
|
f"WHERE habit_users.user_id = {user_id};")
|
||||||
conn = con3()
|
conn = con3()
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|||||||
@ -54,10 +54,9 @@ class User(UserMixin):
|
|||||||
raw_habitLists = get_habitLists(self.id)
|
raw_habitLists = get_habitLists(self.id)
|
||||||
habitLists = []
|
habitLists = []
|
||||||
for habitList in raw_habitLists:
|
for habitList in raw_habitLists:
|
||||||
user_id = habitList[5]
|
|
||||||
accepted = habitList[6]
|
accepted = habitList[6]
|
||||||
habitList = HabitList(habitList[0], habitList[1], habitList[2], habitList[3])
|
habitList = HabitList(habitList[0], habitList[1], habitList[2], habitList[3])
|
||||||
if accepted == 1 or habitList.get_users()[0].id == user_id:
|
if accepted == 1:
|
||||||
habitLists.append(habitList)
|
habitLists.append(habitList)
|
||||||
|
|
||||||
return habitLists
|
return habitLists
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user