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
f7ef1759
Commit
f7ef1759
authored
2 years ago
by
Erwan Rouchet
Browse files
Options
Downloads
Plain Diff
Merge branch 'corpus-types-stale-read' into 'master'
fix corpus types stale read when creating a new element type Closes
#1021
See merge request
!1688
parents
f4a073c3
4e87a5e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1688
fix corpus types stale read when creating a new element type
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/documents/serializers/light.py
+2
-2
2 additions, 2 deletions
arkindex/documents/serializers/light.py
with
2 additions
and
2 deletions
arkindex/documents/serializers/light.py
+
2
−
2
View file @
f7ef1759
...
...
@@ -84,8 +84,8 @@ class ElementTypeLightSerializer(serializers.ModelSerializer):
def
validate
(
self
,
data
):
slug
=
data
.
get
(
'
slug
'
)
if
'
slug
'
in
data
else
self
.
instance
.
slug
corpus
=
data
.
get
(
'
corpus
'
)
if
'
corpus
'
in
data
else
self
.
instance
.
corpus
type
=
corpus
.
types
.
filter
(
slug
=
slug
)
if
type
.
exists
()
and
(
not
self
.
instance
or
type
.
first
().
id
!=
self
.
instance
.
id
):
type
=
corpus
.
types
.
filter
(
slug
=
slug
)
.
using
(
'
default
'
).
first
()
if
type
is
not
None
and
(
not
self
.
instance
or
type
.
id
!=
self
.
instance
.
id
):
raise
ValidationError
({
'
slug
'
:
[
'
Slug must be unique
'
]})
return
data
...
...
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