diff --git a/backend/authentications/views.py b/backend/authentications/views.py index 0c5642d..87f662e 100644 --- a/backend/authentications/views.py +++ b/backend/authentications/views.py @@ -7,7 +7,7 @@ from django.conf import settings from django.contrib.auth.hashers import make_password from rest_framework import status -from rest_framework.permissions import IsAuthenticated, AllowAny +from rest_framework.permissions import AllowAny from rest_framework.response import Response from rest_framework.views import APIView from rest_framework_simplejwt.tokens import RefreshToken diff --git a/backend/users/migrations/0005_alter_userstats_endurance_and_more.py b/backend/users/migrations/0005_alter_userstats_endurance_and_more.py index 35fe6f7..76ec5c3 100644 --- a/backend/users/migrations/0005_alter_userstats_endurance_and_more.py +++ b/backend/users/migrations/0005_alter_userstats_endurance_and_more.py @@ -25,7 +25,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='userstats', name='luck', - field=models.IntegerField(default=users.models.random_luck, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(50)]), + field=models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(50)]), ), migrations.AlterField( model_name='userstats', diff --git a/backend/users/models.py b/backend/users/models.py index 7a765a6..2fe1df6 100644 --- a/backend/users/models.py +++ b/backend/users/models.py @@ -31,14 +31,12 @@ class CustomUser(AbstractBaseUser, PermissionsMixin): # Fields for authentication USERNAME_FIELD = 'email' - REQUIRED_FIELDS = ['username', 'first_name'] + REQUIRED_FIELDS = [] def __str__(self): # String representation of the user return self.username - -def random_luck(): - return random.randint(1, 50) + class UserStats(models.Model): """