Баг фикс

main
through-your-tears 9 months ago
parent 0682896582
commit b509cae947

@ -69,9 +69,3 @@ class Friend(models.Model):
class QRCode(models.Model):
qr_str = models.CharField(max_length=1024, default='', blank=True)
user = models.OneToOneField(CustomUser, on_delete=models.CASCADE)
def save(
self, force_insert=False, force_update=False, using=None, update_fields=None
):
self.qr_str = encrypt(self.user.email)

@ -13,6 +13,7 @@ from rest_framework.response import Response
from rest_framework.views import APIView
from core.permissions import IsAuthorOrReadOnly
from crypto.services import encrypt
from .models import CustomUser, RefreshToken
from .repositories import RefreshTokenRepository, ProfileRepository, UserRepository, QRCodeRepository
from .serializers import RegistrationSerializer, LoginSerializer, CustomUserSerializer, ProfileSerializer, QRCodeSerializer
@ -104,7 +105,7 @@ class RegistrationAPIView(APIView):
serializer.is_valid(raise_exception=True)
serializer.save()
ProfileRepository.create(user=UserRepository.get(serializer.data['email']))
QRCodeRepository.create(user=UserRepository.get(serializer.data['email']))
QRCodeRepository.create(qr_str=encrypt(serializer.data['email']), user=UserRepository.get(serializer.data['email']))
return Response(serializer.data, status=status.HTTP_201_CREATED)

Loading…
Cancel
Save