Add account deletion scheduler and comprehensive tests
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 49s
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 49s
- Implemented account deletion scheduler in `account_deletion_scheduler.py` to manage user deletions based on a defined threshold. - Added logging for deletion processes, including success and error messages. - Created tests for deletion logic, including edge cases, retry logic, and integration tests to ensure complete deletion workflows. - Ensured that deletion attempts are tracked and that users are marked for manual intervention after exceeding maximum attempts. - Implemented functionality to check for interrupted deletions on application startup and retry them.
This commit is contained in:
@@ -18,6 +18,8 @@ class User(BaseModel):
|
||||
pin_setup_code_created: str | None = None
|
||||
marked_for_deletion: bool = False
|
||||
marked_for_deletion_at: str | None = None
|
||||
deletion_in_progress: bool = False
|
||||
deletion_attempted_at: str | None = None
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, d: dict):
|
||||
@@ -37,6 +39,8 @@ class User(BaseModel):
|
||||
pin_setup_code_created=d.get('pin_setup_code_created'),
|
||||
marked_for_deletion=d.get('marked_for_deletion', False),
|
||||
marked_for_deletion_at=d.get('marked_for_deletion_at'),
|
||||
deletion_in_progress=d.get('deletion_in_progress', False),
|
||||
deletion_attempted_at=d.get('deletion_attempted_at'),
|
||||
id=d.get('id'),
|
||||
created_at=d.get('created_at'),
|
||||
updated_at=d.get('updated_at')
|
||||
@@ -60,6 +64,8 @@ class User(BaseModel):
|
||||
'pin_setup_code': self.pin_setup_code,
|
||||
'pin_setup_code_created': self.pin_setup_code_created,
|
||||
'marked_for_deletion': self.marked_for_deletion,
|
||||
'marked_for_deletion_at': self.marked_for_deletion_at
|
||||
'marked_for_deletion_at': self.marked_for_deletion_at,
|
||||
'deletion_in_progress': self.deletion_in_progress,
|
||||
'deletion_attempted_at': self.deletion_attempted_at
|
||||
})
|
||||
return base
|
||||
|
||||
Reference in New Issue
Block a user