#31 API Share
* adds support for GET and PUT of sharing users for all data types (compensation is shared via intervention)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user