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