Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
5b6a197a
Commit
5b6a197a
authored
3 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove call to undefined method in MetaDataUpdateSerializer
parent
e58cfc97
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1448
Remove call to undefined method in MetaDataUpdateSerializer
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/documents/serializers/light.py
+2
-11
2 additions, 11 deletions
arkindex/documents/serializers/light.py
with
2 additions
and
11 deletions
arkindex/documents/serializers/light.py
+
2
−
11
View file @
5b6a197a
...
...
@@ -171,23 +171,14 @@ class MetaDataLightSerializer(serializers.ModelSerializer):
if
metadata
.
exists
():
validated_data
[
'
index
'
]
=
metadata
.
aggregate
(
Max
(
'
index
'
))[
'
index__max
'
]
+
1
original_type
=
instance
.
type
updated_metadata
=
super
().
update
(
instance
,
validated_data
)
if
MetaType
.
Reference
in
(
original_type
,
updated_metadata
.
type
):
# Reindex element reference metadatas
self
.
reindex_element
(
updated_metadata
.
element
)
return
updated_metadata
return
super
().
update
(
instance
,
validated_data
)
def
delete
(
self
,
instance
):
user
=
self
.
context
[
'
request
'
].
user
element
,
meta_type
=
instance
.
element
,
instance
.
type
if
not
(
user
.
is_admin
or
user
.
is_internal
):
self
.
check_allowed
(
corpus
=
element
.
corpus
,
instance
=
instance
)
self
.
check_allowed
(
corpus
=
instance
.
element
.
corpus
,
instance
=
instance
)
instance
.
delete
()
if
meta_type
==
MetaType
.
Reference
:
# Reindex metadata's element
self
.
reindex_element
(
element
)
class
Meta
:
model
=
MetaData
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment