mirror of
https://github.com/logos-co/open-law.git
synced 2025-02-05 11:34:05 +00:00
fix bug with submitting the same collection label
This commit is contained in:
parent
78b09a8274
commit
0145e9618c
@ -407,7 +407,11 @@ def collection_edit(book_id: int, collection_id: int):
|
||||
if form.validate_on_submit():
|
||||
label = form.label.data
|
||||
|
||||
if m.Collection.query.filter_by(label=label).first():
|
||||
if (
|
||||
m.Collection.query.filter_by(label=label)
|
||||
.filter(m.Collection.id != collection_id)
|
||||
.first()
|
||||
):
|
||||
log(
|
||||
log.INFO,
|
||||
"Collection with similar label already exists. Book: [%s], Collection: [%s], Label: [%s]",
|
||||
|
Loading…
x
Reference in New Issue
Block a user