Update User.py
This commit is contained in:
parent
776eaec21b
commit
adeab273a6
@ -2,7 +2,7 @@ from datetime import datetime
|
||||
|
||||
from flask_login import UserMixin
|
||||
from db.SQLiteClient import (create_user, get_user, get_user_by_email, update_user, delete_user,
|
||||
get_habitLists, get_heatmap_value)
|
||||
get_habitLists, get_heatmap_value, update_user_profile)
|
||||
|
||||
|
||||
class User(UserMixin):
|
||||
@ -34,6 +34,8 @@ class User(UserMixin):
|
||||
def update(self):
|
||||
update_user(self.id, self.name, self.email, self.password if self.password else None)
|
||||
|
||||
def update_profile_image(self, profile_image: str):
|
||||
update_user_profile(self.id, profile_image)
|
||||
|
||||
# Deletes the User
|
||||
def delete(self):
|
||||
@ -72,4 +74,5 @@ class User(UserMixin):
|
||||
for day in range (0, 28):
|
||||
value = get_heatmap_value(self.id, day)
|
||||
heatmap.append(value)
|
||||
heatmap.reverse()
|
||||
return heatmap
|
||||
Loading…
x
Reference in New Issue
Block a user