* adds support for GET and PUT of sharing users for all data types (compensation is shared via intervention)
This commit is contained in:
2022-01-26 09:16:37 +01:00
parent 0b723b1529
commit fc0cd2f086
4 changed files with 157 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ from compensation.models import Compensation
from intervention.models import Intervention
from konova.models import Geometry
from konova.tasks import celery_update_parcels
from konova.utils.message_templates import DATA_UNSHARED
from user.models import UserActionLogEntry
@@ -88,7 +89,7 @@ class CompensationAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensa
is_shared = intervention.is_shared_with(user)
if not is_shared:
raise PermissionError("Intervention not shared with user")
raise PermissionError(DATA_UNSHARED)
obj.intervention = intervention
return obj