Completed admin views

Corrected model method return values
This commit is contained in:
2022-06-15 11:23:38 +01:00
parent 126bf9203c
commit a1bee61679
6 changed files with 226 additions and 43 deletions

View File

@@ -99,7 +99,7 @@ class User(UserMixin, db.Model):
return True, message
def update(self, password:str=None, email:str=None, notify:bool=False):
if not password and not email: return False, jsonify({'error': 'There were no changes requested.'})
if not password and not email: return False, 'There were no changes requested.'
if password: self.set_password(password)
if email: self.set_email(email)
db.session.commit()