chore: harmonize cockpit_url and details_url

This commit is contained in:
Livio Bieri 2023-10-25 17:08:15 +02:00
parent d2d5f22536
commit 571b6b347b
3 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ class DashboardQuery(graphene.ObjectType):
return CourseStatisticsType( return CourseStatisticsType(
id=course.id, # noqa id=course.id, # noqa
course_title=course.title, # noqa course_title=course.title, # noqa
course_slug=course.slug, # noqa course_slug=course.slug, # noqa
course_session_selection_ids=list(course_session_ids), # noqa course_session_selection_ids=list(course_session_ids), # noqa
) )

View File

@ -22,7 +22,7 @@ class PresenceRecord(graphene.ObjectType):
due_date = graphene.String(required=True) due_date = graphene.String(required=True)
participants_present = graphene.Int(required=True) participants_present = graphene.Int(required=True)
participants_total = graphene.Int(required=True) participants_total = graphene.Int(required=True)
cockpit_url = graphene.String(required=True) details_url = graphene.String(required=True)
class AttendanceDayPresences(graphene.ObjectType): class AttendanceDayPresences(graphene.ObjectType):
@ -67,7 +67,7 @@ def attendance_day_presences(
due_date=format_swiss_datetime(attendance_day.due_date.end), # noqa due_date=format_swiss_datetime(attendance_day.due_date.end), # noqa
participants_present=participants_present, # noqa participants_present=participants_present, # noqa
participants_total=participants_total, # noqa participants_total=participants_total, # noqa
cockpit_url=url, # noqa details_url=url, # noqa
) )
) )

View File

@ -90,7 +90,7 @@ class DashboardAttendanceTestCase(GraphQLTestCase):
due_date due_date
participants_present participants_present
participants_total participants_total
cockpit_url details_url
}} }}
}} }}
}} }}
@ -113,7 +113,7 @@ class DashboardAttendanceTestCase(GraphQLTestCase):
self.assertEqual(record["participants_present"], 1) self.assertEqual(record["participants_present"], 1)
self.assertEqual(record["participants_total"], 3) self.assertEqual(record["participants_total"], 3)
self.assertEqual( self.assertEqual(
record["cockpit_url"], record["details_url"],
f"/course/test-lehrgang/cockpit/attendance?id={attendance_course.learning_content.id}&courseSessionId={course_session.id}", f"/course/test-lehrgang/cockpit/attendance?id={attendance_course.learning_content.id}&courseSessionId={course_session.id}",
) )