Skip to content

Commit

Permalink
feat: non-required fields optional in admin
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharis278 committed Aug 21, 2024
1 parent 6289113 commit 153a09c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 7 deletions.
63 changes: 63 additions & 0 deletions edx_exams/apps/core/migrations/0028_admin_optional_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Generated by Django 4.2.13 on 2024-08-21 13:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0027_coursestaffrole_unique_course_staff_role'),
]

operations = [
migrations.AlterField(
model_name='exam',
name='due_date',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='examattempt',
name='end_time',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='examattempt',
name='start_time',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='historicalexam',
name='due_date',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='historicalexamattempt',
name='end_time',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='historicalexamattempt',
name='start_time',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='proctoringprovider',
name='org_key',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='proctoringprovider',
name='tech_support_email',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='proctoringprovider',
name='tech_support_phone',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='proctoringprovider',
name='tech_support_url',
field=models.URLField(blank=True, max_length=255, null=True),
),
]
14 changes: 7 additions & 7 deletions edx_exams/apps/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ class ProctoringProvider(TimeStampedModel):

lti_configuration_id = models.CharField(max_length=255, db_index=True)

org_key = models.CharField(max_length=255, null=True)
org_key = models.CharField(max_length=255, null=True, blank=True)

tech_support_phone = models.CharField(max_length=255, null=True)
tech_support_phone = models.CharField(max_length=255, null=True, blank=True)

tech_support_email = models.CharField(max_length=255, null=True)
tech_support_email = models.CharField(max_length=255, null=True, blank=True)

tech_support_url = models.URLField(max_length=255, null=True)
tech_support_url = models.URLField(max_length=255, null=True, blank=True)

class Meta:
""" Meta class for this Django model """
Expand Down Expand Up @@ -140,7 +140,7 @@ class Exam(TimeStampedModel):
time_limit_mins = models.PositiveIntegerField()

# Due date is a deadline to finish the exam
due_date = models.DateTimeField(null=True)
due_date = models.DateTimeField(null=True, blank=True)

# Whether to hide this exam after the due date
hide_after_due = models.BooleanField(default=False)
Expand Down Expand Up @@ -208,9 +208,9 @@ class ExamAttempt(TimeStampedModel):

status = models.CharField(max_length=64, choices=[(status, status) for status in STATUS_CHOICES])

start_time = models.DateTimeField(null=True)
start_time = models.DateTimeField(null=True, blank=True)

end_time = models.DateTimeField(null=True)
end_time = models.DateTimeField(null=True, blank=True)

allowed_time_limit_mins = models.IntegerField(null=True)

Expand Down

0 comments on commit 153a09c

Please sign in to comment.