Commit 1c8ab2c2 authored by BAIRE Anthony's avatar BAIRE Anthony

remove check to prevent creation of local accounts if disabled

for two reasons:
- it is no longer a concern since email addresses are well verified now
- it was broken (an entry would be created in auth_user anyway,
  whereas the other tables would not be updated)
- it was doubly broken (raise PermissionError on first gitlab login too)
parent a1bf56d4
......@@ -4,7 +4,6 @@ import os
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.models import User, AnonymousUser
from django.core.exceptions import PermissionDenied
from django.core.validators import MinLengthValidator, MinValueValidator, \
RegexValidator
from django.db import models
......@@ -658,10 +657,6 @@ class UserAgreement(BaseModel):
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
if (not config.settings.parse_bool(config.env.ALLGO_ALLOW_LOCAL_ACCOUNTS)
and not SocialAccount.objects.filter(user=instance).exists()):
# creation of local user accounts not allowed
raise PermissionDenied
AllgoUser.objects.create(user=instance)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment