Clean other editor when a real editor is found
This commit is contained in:
parent
df8ef43b58
commit
d235f61e5a
1 changed files with 5 additions and 1 deletions
|
@ -290,8 +290,12 @@ class Book(BaseModel):
|
|||
potential_editor = (
|
||||
Editor.objects.filter(name__iexact=editor).first()
|
||||
or Editor.objects.filter(name__icontains=editor).first()
|
||||
or Editor.objects.get(name__istartswith="autre")
|
||||
)
|
||||
if potential_editor:
|
||||
self.other_editor = ""
|
||||
else:
|
||||
potential_editor = Editor.objects.get(name__istartswith="autre")
|
||||
self.other_editor = editor
|
||||
|
||||
self.editor = potential_editor
|
||||
self.save()
|
||||
|
|
Loading…
Reference in a new issue