Skip to content
Snippets Groups Projects
Commit 44c40354 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch...

Merge branch '245-group-types-that-are-managed-by-some-app-e-g-cursus-school-class-can-t-be-selected-as-timetable' into 'master'

Resolve "Group types that are managed by some app (e.g. cursus' "school class") can't be selected as timetable group type"

Closes #245

See merge request !350
parents 647ff918 74687b67
No related branches found
No related tags found
1 merge request!350Resolve "Group types that are managed by some app (e.g. cursus' "school class") can't be selected as timetable group type"
Pipeline #186602 failed
Pipeline: AlekSIS

#186604

    ...@@ -878,12 +878,10 @@ class LessonEventQuerySet(PolymorphicQuerySet): ...@@ -878,12 +878,10 @@ class LessonEventQuerySet(PolymorphicQuerySet):
    def for_participant(self, person: Union[int, Person]) -> "LessonEventQuerySet": def for_participant(self, person: Union[int, Person]) -> "LessonEventQuerySet":
    """Get all lesson events the person participates in (including amends).""" """Get all lesson events the person participates in (including amends)."""
    amended = self.filter( amended = self.filter(Q(amended_by__isnull=False) | Q(groups__members=person)).values_list(
    Q(amended_by__isnull=False) | Q(groups__members=person) "amended_by__pk", flat=True
    ).values_list("amended_by__pk", flat=True) )
    return self.filter( return self.filter(Q(groups__members=person) | Q(pk__in=amended)).distinct()
    Q(groups__members=person) | Q(pk__in=amended)
    ).distinct()
    def for_group(self, group: Union[int, Group]) -> "LessonEventQuerySet": def for_group(self, group: Union[int, Group]) -> "LessonEventQuerySet":
    """Get all lesson events for a certain group (including amends/as parent group).""" """Get all lesson events for a certain group (including amends/as parent group)."""
    ......
    ...@@ -127,9 +127,6 @@ class GroupTypesTimetables(ModelMultipleChoicePreference): ...@@ -127,9 +127,6 @@ class GroupTypesTimetables(ModelMultipleChoicePreference):
    verbose_name = _("Group types to show in timetables") verbose_name = _("Group types to show in timetables")
    help_text = _("If you leave it empty, all groups will be shown.") help_text = _("If you leave it empty, all groups will be shown.")
    def get_queryset(self):
    return GroupType.objects.managed_and_unmanaged()
    @site_preferences_registry.register @site_preferences_registry.register
    class LessonEventFeedColor(StringPreference): class LessonEventFeedColor(StringPreference):
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment