Compare commits

..

No commits in common. "722db5feae27808b6beb64c3afc7eceef0d77db9" and "d17a76f4b8a7cd3ff59d648fe772d41c0fd69421" have entirely different histories.

2 changed files with 4 additions and 10 deletions

View File

@ -14,9 +14,9 @@ class User(UserMixin, db.Model):
email = db.Column(db.String(120), index=True, unique=True) email = db.Column(db.String(120), index=True, unique=True)
profile_pic = db.Column(db.String(256)) profile_pic = db.Column(db.String(256))
password_hash = db.Column(db.String(128)) password_hash = db.Column(db.String(128))
google_token = db.relationship('GoogleToken', uselist=False, backref = 'user', cascade="all, delete-orphan") google_token = db.relationship('GoogleToken', uselist=False, backref = 'user')
calendars = db.relationship('Calendar', backref='user', lazy=True, cascade="all, delete-orphan") calendars = db.relationship('Calendar', backref='user', lazy=True)
devices = db.relationship('Device', backref='user', cascade="all, delete-orphan") devices = db.relationship('Device', backref='user')
def __repr__(self): def __repr__(self):
return '<User {}>'.format(self.username) return '<User {}>'.format(self.username)

View File

@ -107,13 +107,7 @@ def deleteAccount():
return redirect(url_for('account')) return redirect(url_for('account'))
# 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()