Completed admin views
Corrected model method return values
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user