Raised to prevent that the system wouldn’t have any admin user. Without any admin user, the system would effectively be in a locked state where no one can manage the settings anymore. (Including e.g. creating a new admin user, or otherwise elevating a user’s privileges.) Note that
| 62 | |
| 63 | |
| 64 | class OneAdminRequiredError(Error): |
| 65 | """Raised to prevent that the system wouldn’t have any admin user. |
| 66 | |
| 67 | Without any admin user, the system would effectively be in a locked state |
| 68 | where no one can manage the settings anymore. (Including e.g. creating a |
| 69 | new admin user, or otherwise elevating a user’s privileges.) |
| 70 | |
| 71 | Note that the purpose of this error is to protect the system’s integrity as |
| 72 | a whole. In addition to that, we may also carry out separate checks (e.g. |
| 73 | in the API layer) to prevent the current user from accidentally locking |
| 74 | themselves out individually (without violating the system integrity). |
| 75 | """ |
| 76 | |
| 77 | |
| 78 | def _user_from_strings(username, role, credentials_last_changed): |
no outgoing calls
no test coverage detected