Make `start` in DueDate mandatory
This commit is contained in:
parent
969c55f15d
commit
acdda923da
|
|
@ -216,7 +216,7 @@ export const useCourseSessionsStore = defineStore("courseSessions", () => {
|
|||
if (!dateA.isValid()) return 1; // If dateA is invalid, it goes after dateB
|
||||
if (!dateB.isValid()) return -1; // If dateB is invalid, it goes after dateA
|
||||
|
||||
return dateA.diff(dateB); // Otherwise, sort by the end date
|
||||
return dateA.diff(dateB); // sort by `start`
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ from vbv_lernwelt.course_session.models import (
|
|||
|
||||
@admin.register(CourseSessionAttendanceCourse)
|
||||
class CourseSessionAttendanceCourseAdmin(admin.ModelAdmin):
|
||||
# Inline fields are not possible for the DueDate model, because it is not a ForeignKey relatoion.
|
||||
readonly_fields = [
|
||||
"course_session",
|
||||
"learning_content",
|
||||
|
|
@ -25,8 +24,12 @@ class CourseSessionAttendanceCourseAdmin(admin.ModelAdmin):
|
|||
|
||||
@admin.register(CourseSessionAssignment)
|
||||
class CourseSessionAssignmentAdmin(admin.ModelAdmin):
|
||||
# Inline fields are not possible for the DueDate model, because it is not a ForeignKey relatoion.
|
||||
readonly_fields = ["course_session", "learning_content"]
|
||||
readonly_fields = [
|
||||
"course_session",
|
||||
"learning_content",
|
||||
"submission_deadline",
|
||||
"evaluation_deadline",
|
||||
]
|
||||
list_display = [
|
||||
"course_session",
|
||||
"learning_content",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 3.2.20 on 2023-08-23 13:15
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("duedate", "0003_auto_20230823_1126"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="duedate",
|
||||
name="start",
|
||||
field=models.DateTimeField(
|
||||
db_index=True, help_text="Startdatum ist Pflicht", null=True
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
@ -10,7 +10,7 @@ from vbv_lernwelt.course.models import CourseSession
|
|||
|
||||
class DueDate(models.Model):
|
||||
start = models.DateTimeField(
|
||||
null=True, blank=True, db_index=True, help_text="Startdatum ist Pflicht"
|
||||
null=True, db_index=True, help_text="Startdatum ist Pflicht"
|
||||
)
|
||||
end = models.DateTimeField(
|
||||
null=True, blank=True, db_index=True, help_text="Enddatum ist optional"
|
||||
|
|
|
|||
Loading…
Reference in New Issue