Disable not partial updates on attachment resources.
PUT request does not supports multipart request, but attached_file is required. Because of this condition, put requests for attachments resources are not possible, for it, them are disabled explicitly.remotes/origin/enhancement/email-actions
parent
f0ec998576
commit
6dc0168836
|
@ -34,7 +34,6 @@ from taiga.users.models import User
|
||||||
from taiga.projects.notifications import WatchedResourceMixin
|
from taiga.projects.notifications import WatchedResourceMixin
|
||||||
from taiga.projects.history import HistoryResourceMixin
|
from taiga.projects.history import HistoryResourceMixin
|
||||||
|
|
||||||
|
|
||||||
from . import permissions
|
from . import permissions
|
||||||
from . import serializers
|
from . import serializers
|
||||||
from . import models
|
from . import models
|
||||||
|
@ -47,6 +46,12 @@ class BaseAttachmentViewSet(HistoryResourceMixin, WatchedResourceMixin, ModelCru
|
||||||
|
|
||||||
content_type = None
|
content_type = None
|
||||||
|
|
||||||
|
def update(self, *args, **kwargs):
|
||||||
|
partial = kwargs.get("partial", False)
|
||||||
|
if not partial:
|
||||||
|
raise exc.NotSupported("Non partial updates not supported")
|
||||||
|
return super().update(*args, **kwargs)
|
||||||
|
|
||||||
def get_content_type(self):
|
def get_content_type(self):
|
||||||
app_name, model = self.content_type.split(".", 1)
|
app_name, model = self.content_type.split(".", 1)
|
||||||
return get_object_or_404(ContentType, app_label=app_name, model=model)
|
return get_object_or_404(ContentType, app_label=app_name, model=model)
|
||||||
|
|
Loading…
Reference in New Issue