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

Merge branch '358-adapt-to-managed_by-change' into 'master'

Adapt to core changes

Closes #358

See merge request !479
parents f84e6bc7 6271b8c7
No related branches found
No related tags found
1 merge request!479Adapt to core changes
Pipeline #196822 canceled
......@@ -11,7 +11,7 @@ from calendarweek import CalendarWeek
from aleksis.apps.chronos.models import LessonEvent
from aleksis.core.managers import (
AlekSISBaseManagerWithoutMigrations,
RecurrencePolymorphicManager,
CalendarEventManager,
)
if TYPE_CHECKING:
......@@ -73,7 +73,7 @@ class GroupRoleAssignmentQuerySet(QuerySet):
return self.filter(Q(groups=group) | Q(groups__child_groups=group))
class DocumentationManager(RecurrencePolymorphicManager):
class DocumentationManager(CalendarEventManager):
"""Manager adding specific methods to documentations."""
def for_school_term(self, school_term: "SchoolTerm") -> QuerySet["Documentation"]:
......@@ -107,7 +107,7 @@ class DocumentationManager(RecurrencePolymorphicManager):
)
class ParticipationStatusManager(RecurrencePolymorphicManager):
class ParticipationStatusManager(CalendarEventManager):
"""Manager adding specific methods to participation statuses."""
pass
......@@ -102,6 +102,3 @@ class GroupTypePriorityCoursebook(ModelChoicePreference):
"select field on the coursebook overview page"
)
help_text = _("If you leave it empty, no group type will be used.")
def get_queryset(self):
return GroupType.objects.managed_and_unmanaged()
......@@ -29,6 +29,7 @@ class ExtraMarkBatchCreateMutation(BaseBatchCreateMutation):
model = ExtraMark
fields = ("short_name", "name", "colour_fg", "colour_bg", "show_in_coursebook")
optional_fields = ("name",)
permissions = ("alsijil.create_extramark_rule",)
@classmethod
def check_permissions(cls, root, info, input): # noqa
......@@ -40,6 +41,7 @@ class ExtraMarkBatchCreateMutation(BaseBatchCreateMutation):
class ExtraMarkBatchDeleteMutation(BaseBatchDeleteMutation):
class Meta:
model = ExtraMark
permissions = ("alsijil.create_extramark_rule",)
@classmethod
def check_permissions(cls, root, info, input): # noqa
......@@ -52,6 +54,7 @@ class ExtraMarkBatchPatchMutation(BaseBatchPatchMutation):
class Meta:
model = ExtraMark
fields = ("id", "short_name", "name", "colour_fg", "colour_bg", "show_in_coursebook")
permissions = ("alsijil.create_extramark_rule",)
@classmethod
def check_permissions(cls, root, info, input): # noqa
......
......@@ -86,6 +86,7 @@ class ParticipationStatusBatchPatchMutation(BaseBatchPatchMutation):
"tardiness",
) # Only the reason and tardiness can be updated after creation
return_field_name = "participationStatuses"
permissions = ("alsijil.edit_participation_status_for_documentation_with_time_range_rule",)
@classmethod
def check_permissions(cls, root, info, input, *args, **kwargs): # noqa: A002
......
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