From 2c9456e5d4924403c8e229ef5d12f3d0eb0d1aa8 Mon Sep 17 00:00:00 2001 From: Veriny <2002.ijustin@gmail.com> Date: Mon, 6 Nov 2023 19:46:45 -0800 Subject: [PATCH] migrations --- ..._user_is_private_user_pronouns_and_more.py | 42 +++++++++++++++++++ csm_web/scheduler/models.py | 16 +++---- 2 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 csm_web/scheduler/migrations/0033_user_bio_user_is_private_user_pronouns_and_more.py diff --git a/csm_web/scheduler/migrations/0033_user_bio_user_is_private_user_pronouns_and_more.py b/csm_web/scheduler/migrations/0033_user_bio_user_is_private_user_pronouns_and_more.py new file mode 100644 index 00000000..e565fb5b --- /dev/null +++ b/csm_web/scheduler/migrations/0033_user_bio_user_is_private_user_pronouns_and_more.py @@ -0,0 +1,42 @@ +# Generated by Django 4.2.1 on 2023-11-07 03:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("scheduler", "0032_word_of_the_day"), + ] + + operations = [ + migrations.AddField( + model_name="user", + name="bio", + field=models.CharField( + default="Default bio given to everyone~", max_length=300 + ), + ), + migrations.AddField( + model_name="user", + name="is_private", + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name="user", + name="pronouns", + field=models.CharField( + blank=True, + choices=[ + ("he/him", "He"), + ("she/her", "She"), + ("they/them", "They"), + ("", "None"), + ], + ), + ), + migrations.AddField( + model_name="user", + name="pronunciation", + field=models.CharField(default="", max_length=20), + ), + ] diff --git a/csm_web/scheduler/models.py b/csm_web/scheduler/models.py index d22abf01..c4890dcb 100644 --- a/csm_web/scheduler/models.py +++ b/csm_web/scheduler/models.py @@ -59,9 +59,9 @@ class Pronouns(models.TextChoices): pronouns = models.CharField(choices=Pronouns.choices, blank=True) is_private = models.BooleanField(default=False) - pronunciation = models.CharField(max_length=20) + pronunciation = models.CharField(max_length=20, default="") - bio = models.CharField(max_length=300) + bio = models.CharField(max_length=300, default="Default bio given to everyone~") def can_enroll_in_course(self, course, bypass_enrollment_time=False): """Determine whether this user is allowed to enroll in the given course.""" @@ -272,19 +272,15 @@ def save(self, *args, **kwargs): ): if settings.DJANGO_ENV != settings.DEVELOPMENT: logger.info( - ( - " SO automatically created for student" - " %s in course %s for date %s" - ), + " SO automatically created for student" + " %s in course %s for date %s", self.user.email, course.name, now.date(), ) logger.info( - ( - " Attendance automatically created for student" - " %s in course %s for date %s" - ), + " Attendance automatically created for student" + " %s in course %s for date %s", self.user.email, course.name, now.date(),