Skip to content

Commit

Permalink
migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Veriny committed Nov 7, 2023
1 parent fe479b4 commit 2c9456e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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),
),
]
16 changes: 6 additions & 10 deletions csm_web/scheduler/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -272,19 +272,15 @@ def save(self, *args, **kwargs):
):
if settings.DJANGO_ENV != settings.DEVELOPMENT:
logger.info(
(
"<SectionOccurrence> SO automatically created for student"
" %s in course %s for date %s"
),
"<SectionOccurrence> SO automatically created for student"
" %s in course %s for date %s",
self.user.email,
course.name,
now.date(),
)
logger.info(
(
"<Attendance> Attendance automatically created for student"
" %s in course %s for date %s"
),
"<Attendance> Attendance automatically created for student"
" %s in course %s for date %s",
self.user.email,
course.name,
now.date(),
Expand Down

0 comments on commit 2c9456e

Please sign in to comment.