Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Marta Miranda
/
boletin_api
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Enzo Yair
2023-09-14 12:05:32 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c2aa502c2f132841d88c2bb4ab36560151247621
c2aa502c
1 parent
0d683ba4
se cambio de metodo de put a patch
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
project/apps/edicto/api.py
project/apps/edicto/serializer.py
project/apps/edicto/api.py
View file @
c2aa502
...
...
@@ -36,7 +36,7 @@ class EdictoViewSet(mixins.CreateModelMixin,
usuario_movimiento
=
usuario
,
)
@action
(
detail
=
True
,
methods
=
[
'p
ut
'
])
@action
(
detail
=
True
,
methods
=
[
'p
atch
'
])
def
custom_update
(
self
,
request
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
,
data
=
request
.
data
)
...
...
project/apps/edicto/serializer.py
View file @
c2aa502
...
...
@@ -40,7 +40,7 @@ class EdictoSerializer(serializers.ModelSerializer):
def
to_representation
(
self
,
instance
):
data
=
super
()
.
to_representation
(
instance
)
if
instance
.
fecha_modificacion
is
not
None
and
self
.
context
[
'request'
]
.
method
==
'P
UT
'
:
if
instance
.
fecha_modificacion
is
not
None
and
self
.
context
[
'request'
]
.
method
==
'P
ATCH
'
:
data
[
'fecha_modificacion'
]
=
instance
.
fecha_modificacion
else
:
data
[
'fecha_modificacion'
]
=
None
...
...
Please
register
or
login
to post a comment