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

Merge branch 'fix/cancelled-participation-status' into 'master'

Fix design for cancelled lessons and don't allow participation status with cancelled lessons

See merge request !371
parents 921f316c 3105d246
No related branches found
No related tags found
1 merge request!371Fix design for cancelled lessons and don't allow participation status with cancelled lessons
Pipeline #191499 failed
...@@ -58,6 +58,7 @@ export default { ...@@ -58,6 +58,7 @@ export default {
v-bind="documentationPartProps" v-bind="documentationPartProps"
@update="() => null" @update="() => null"
:loading-indicator="loading" :loading-indicator="loading"
v-if="!documentation.amends?.cancelled"
> >
<template #activator="{ attrs, on }"> <template #activator="{ attrs, on }">
<v-chip <v-chip
......
...@@ -38,6 +38,10 @@ import PersonChip from "aleksis.core/components/person/PersonChip.vue"; ...@@ -38,6 +38,10 @@ import PersonChip from "aleksis.core/components/person/PersonChip.vue";
:subject="documentation.subject" :subject="documentation.subject"
v-bind="compact ? dialogActivator.attrs : {}" v-bind="compact ? dialogActivator.attrs : {}"
v-on="compact ? dialogActivator.on : {}" v-on="compact ? dialogActivator.on : {}"
:class="{
'text-decoration-line-through': documentation.amends?.cancelled,
}"
:disabled="documentation.amends?.cancelled"
/> />
<subject-chip <subject-chip
v-if=" v-if="
......
...@@ -695,6 +695,7 @@ class Documentation(CalendarEvent): ...@@ -695,6 +695,7 @@ class Documentation(CalendarEvent):
self.participation_touched_at self.participation_touched_at
or not self.amends or not self.amends
or self.value_start_datetime(self) > now() or self.value_start_datetime(self) > now()
or self.amends.cancelled
): ):
# There is no source to update from or it's too early # There is no source to update from or it's too early
return return
......
...@@ -450,6 +450,8 @@ def can_edit_documentation(user: User, obj: Documentation): ...@@ -450,6 +450,8 @@ def can_edit_documentation(user: User, obj: Documentation):
def can_view_participation_status(user: User, obj: Documentation): def can_view_participation_status(user: User, obj: Documentation):
"""Predicate which checks if the user is allowed to view participation for a documentation.""" """Predicate which checks if the user is allowed to view participation for a documentation."""
if obj: if obj:
if obj.amends and obj.amends.cancelled:
return False
if is_documentation_teacher(user, obj): if is_documentation_teacher(user, obj):
return True return True
if obj.amends: if obj.amends:
...@@ -465,6 +467,8 @@ def can_view_participation_status(user: User, obj: Documentation): ...@@ -465,6 +467,8 @@ def can_view_participation_status(user: User, obj: Documentation):
def can_edit_participation_status(user: User, obj: Documentation): def can_edit_participation_status(user: User, obj: Documentation):
"""Predicate which checks if the user is allowed to edit participation for a documentation.""" """Predicate which checks if the user is allowed to edit participation for a documentation."""
if obj: if obj:
if obj.amends and obj.amends.cancelled:
return False
if is_documentation_teacher(user, obj): if is_documentation_teacher(user, obj):
return True return True
if obj.amends: if obj.amends:
......
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