Skip to content

Commit

Permalink
Move random id generator function to serializers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
itsPedro231 committed Nov 4, 2023
1 parent 79e2952 commit d67d112
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions api/optimeet/groups/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from typing import Any
from django.db import models
from random import randint
import django

def rnd_id(): return randint(1000000000,9999999999)

class Group(models.Model):

Expand Down
4 changes: 3 additions & 1 deletion api/optimeet/groups/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from rest_framework import serializers
from . import models
from .models import rnd_id
from random import randint

def rnd_id(): return randint(1000000000,9999999999)

class GroupSerializer(serializers.ModelSerializer):
class Meta:
Expand Down
1 change: 0 additions & 1 deletion api/optimeet/groups/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.views.decorators.csrf import csrf_exempt
from rest_framework.parsers import JSONParser
from rest_framework import status
from django import db

from . import models
from . import serializers
Expand Down
3 changes: 0 additions & 3 deletions api/optimeet/optimeet/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@
}
}




# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators

Expand Down

0 comments on commit d67d112

Please sign in to comment.