-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1833 from gtech-mulearn:dev
[PATCH] user delete patch
- Loading branch information
Showing
13 changed files
with
137 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
from django.apps import AppConfig | ||
from decouple import config | ||
|
||
|
||
class SystemUserNotFoundError(Exception): | ||
pass | ||
|
||
|
||
class DbConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "db" | ||
|
||
def ready(self) -> None: | ||
_ready = super().ready() | ||
self.check_system_user_exists() | ||
return _ready | ||
|
||
@classmethod | ||
def check_system_user_exists(cls): | ||
from db.user import User | ||
if not User.objects.filter(id=config("SYSTEM_ADMIN_ID")).exists(): | ||
raise SystemUserNotFoundError( | ||
f"Create a System User with pk -\"{config('SYSTEM_ADMIN_ID')}\"" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.