utils.py 316 B

1234567891011
  1. from django.conf import settings
  2. from users.models import User
  3. def is_user_registration_open() -> bool:
  4. return settings.ENABLE_USER_REGISTRATION or not User.objects.exists()
  5. def noop_token_creator(token_model, user, serializer):
  6. """Fake token creator to use sessions instead of tokens"""
  7. return None