summaryrefslogtreecommitdiff
path: root/workshop_app/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'workshop_app/models.py')
-rw-r--r--workshop_app/models.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/workshop_app/models.py b/workshop_app/models.py
index 35a1f38..5e7734c 100644
--- a/workshop_app/models.py
+++ b/workshop_app/models.py
@@ -11,7 +11,7 @@ position_choices = (
)
department_choices = (
- ("computer", "Computer Science"),
+ ("computer engineering", "Computer Science"),
("information technology", "Information Technology"),
("civil engineering", "Civil Engineering"),
("electrical engineering", "Electrical Engineering"),
@@ -24,6 +24,7 @@ department_choices = (
("others", "Others"),
)
+
def has_profile(user):
""" check if user has profile """
return True if hasattr(user, 'profile') else False
@@ -38,12 +39,12 @@ class Profile(models.Model):
institute = models.CharField(max_length=150)
department = models.CharField(max_length=150, choices=department_choices)
phone_number = models.CharField(
- max_length=15,
+ max_length=10,
validators=[RegexValidator(
- regex=r'^.{9}$', message=(
+ regex=r'^.{10}$', message=(
"Phone number must be entered \
- in the format: '+99999999'.\
- Up to 15 digits allowed.")
+ in the format: '9999999999'.\
+ Up to 10 digits allowed.")
)]
,null=False)
position = models.CharField(max_length=32, choices=position_choices,