Make /openapi/setattribute PUT only for REST style compatability

This commit is contained in:
Griatch 2025-11-19 20:12:27 +01:00
parent 20dcb19776
commit 3170c23f9c
2 changed files with 3 additions and 2 deletions

View file

@ -58,7 +58,7 @@ class TypeclassViewSetMixin(GeneralViewSetMixin):
# for example: mygame.com/api/objects?db_key=bob to find matches based on objects having a db_key of bob
filter_backends = [DjangoFilterBackend]
@action(detail=True, methods=["put", "post"])
@action(detail=True, methods=["put"])
def set_attribute(self, request, pk=None):
"""
This action will set an attribute if the db_value is defined, or remove

View file

@ -15,6 +15,7 @@
<redoc spec-url='{% url schema_url %}'></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
<script type="module" src="https://cdn.redoc.ly/redoc/v3.0.0-rc.0/redoc.standalone.js"> </script>
{% endblock %}