Reset updates
This commit is contained in:
@@ -27,6 +27,30 @@ class PasswordReset(db.Model):
|
||||
"updated": self.updated.isoformat() if self.updated else None,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def get_rest_with_uid(cls, pening_uid):
|
||||
"""
|
||||
Return all offers in dictionary format.
|
||||
"""
|
||||
pass_reset = cls.query.filter_by(uid = pening_uid).first()
|
||||
if not pass_reset:
|
||||
raise ValueError(f"Password Reset with UID {pening_uid} does not exist.")
|
||||
return pass_reset
|
||||
|
||||
@classmethod
|
||||
def update_status(cls, reset_id, status):
|
||||
# Retrieve Reset
|
||||
reset_p = cls.query.get(reset_id)
|
||||
|
||||
if not reset_p:
|
||||
raise ValueError(f"Reset with ID {reset_id} does not exist.")
|
||||
|
||||
if reset_p.status == status:
|
||||
return
|
||||
|
||||
# Update reset_p status and the updated_at timestamp
|
||||
reset_p.status = status
|
||||
|
||||
@classmethod
|
||||
def create_reset(cls, username):
|
||||
logger.info(f"Enter to reset the password********** "+username)
|
||||
|
||||
Reference in New Issue
Block a user