Skip to content

Commit

Permalink
Merge pull request #344 from betagouv/userfix
Browse files Browse the repository at this point in the history
Login bug fix
  • Loading branch information
alemangui authored Mar 28, 2024
2 parents 7d3546e + 34b0fac commit 1d019bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions data/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ 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)
return user

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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/LoginPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 1d019bc

Please sign in to comment.