mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-18 13:34:08 +01:00
Modify user model, remove unuse function
This commit is contained in:
parent
a20344c221
commit
3341b3f2a5
@ -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
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user