updated removal process for database elements

This commit is contained in:
Raphael Maenle 2020-05-27 20:45:19 +02:00
parent d17a76f4b8
commit 120931dc4c

View File

@ -108,6 +108,12 @@ def deleteAccount():
# TODO fix google delete account # TODO fix google delete account
google.deleteAccount(current_user) google.deleteAccount(current_user)
for cal in current_user.calendars:
db.session.delete(cal)
for dev in current_user.devices:
db.session.delete(dev)
db.session.delete(current_user.google_token)
db.session.delete(current_user) db.session.delete(current_user)
db.session.commit() db.session.commit()
logout_user() logout_user()