Reset updates

This commit is contained in:
CHIEFSOFT\ameye
2025-08-04 20:55:34 -04:00
parent 58f587619e
commit 6e69b241ef
3 changed files with 37 additions and 3 deletions
+24
View File
@@ -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)