From eda7fb72862aecfc5b055e512da8fc1e73ec39cd Mon Sep 17 00:00:00 2001 From: SKairinos Date: Thu, 14 Sep 2023 15:04:01 +0100 Subject: [PATCH] fix: add user type --- codeforlife/user/models/user.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/codeforlife/user/models/user.py b/codeforlife/user/models/user.py index 29c6c61d..f14a0105 100644 --- a/codeforlife/user/models/user.py +++ b/codeforlife/user/models/user.py @@ -1,8 +1,8 @@ -import typing as t from datetime import timedelta +from enum import Enum -from django.contrib.auth.models import UserManager as AbstractUserManager from django.contrib.auth.models import AbstractUser +from django.contrib.auth.models import UserManager as AbstractUserManager from django.db import models from django.utils import timezone @@ -20,6 +20,11 @@ def create_superuser( class User(AbstractUser): + class Type(str, Enum): + TEACHER = "teacher" + DEP_STUDENT = "dependent-student" + INDEP_STUDENT = "independent-student" + developer = models.BooleanField(default=False) is_verified = models.BooleanField(default=False)