diff --git a/data/models/user.py b/data/models/user.py index 33515a74..253d0948 100644 --- a/data/models/user.py +++ b/data/models/user.py @@ -37,6 +37,7 @@ def create_user(self, email, password=None, **extra_fields): def create_superuser(self, email, password, **extra_fields): user = self.create_user(email, password, **extra_fields) + user.is_verified = True user.is_staff = True user.is_superuser = True user.save(using=self._db) @@ -44,6 +45,7 @@ def create_superuser(self, email, password, **extra_fields): def create_staffuser(self, email, password, **extra_fields): user = self.create_user(email, password, **extra_fields) + user.is_verified = True user.is_staff = True user.save(using=self._db) return user diff --git a/frontend/src/views/LoginPage.vue b/frontend/src/views/LoginPage.vue index d85fd729..da53505f 100644 --- a/frontend/src/views/LoginPage.vue +++ b/frontend/src/views/LoginPage.vue @@ -92,7 +92,7 @@ const submit = async () => { // Give the ability to ask for a new e-email, only if the user is not verified yet. // ⛔️ TODO: change this dirty hack: we use error message until having appropriate error codes in responses - if ($externalResults.value.nonFieldErrors[0].includes("vérifié")) { + if ($externalResults.value?.nonFieldErrors[0].includes("vérifié")) { showSendNewConfirmationMail.value = true userIdForNewConfirmationMail.value = $externalResults.value.extra.userId }