mirror of https://github.com/logos-co/open-law.git
commit
a313a766e3
|
@ -73,9 +73,8 @@ def create():
|
|||
m.Collection(
|
||||
label="Root Collection", version_id=version.id, is_root=True
|
||||
).save()
|
||||
tags = form.tags.data
|
||||
if tags:
|
||||
set_book_tags(book, tags)
|
||||
tags = form.tags.data or ""
|
||||
set_book_tags(book, tags)
|
||||
|
||||
flash("Book added!", "success")
|
||||
return redirect(url_for("book.my_library"))
|
||||
|
@ -97,9 +96,8 @@ def edit(book_id: int):
|
|||
book: m.Book = db.session.get(m.Book, book_id)
|
||||
label = form.label.data
|
||||
about = form.about.data
|
||||
tags = form.tags.data
|
||||
if tags:
|
||||
set_book_tags(book, tags)
|
||||
tags = form.tags.data or ""
|
||||
set_book_tags(book, tags)
|
||||
|
||||
book.label = label
|
||||
book.about = about
|
||||
|
|
|
@ -102,8 +102,7 @@ def create_comment(
|
|||
comment.save()
|
||||
|
||||
tags = current_app.config["TAG_REGEX"].findall(text)
|
||||
if tags:
|
||||
set_comment_tags(comment, tags)
|
||||
set_comment_tags(comment, tags)
|
||||
|
||||
flash("Success!", "success")
|
||||
return redirect(redirect_url)
|
||||
|
@ -198,8 +197,7 @@ def comment_edit(
|
|||
log(log.INFO, "Edit comment [%s]", comment)
|
||||
|
||||
tags = current_app.config["TAG_REGEX"].findall(text)
|
||||
if tags:
|
||||
set_comment_tags(comment, tags)
|
||||
set_comment_tags(comment, tags)
|
||||
|
||||
comment.save()
|
||||
|
||||
|
|
|
@ -141,8 +141,7 @@ def interpretation_create(
|
|||
interpretation.save()
|
||||
|
||||
tags = current_app.config["TAG_REGEX"].findall(text)
|
||||
if tags:
|
||||
set_interpretation_tags(interpretation, tags)
|
||||
set_interpretation_tags(interpretation, tags)
|
||||
|
||||
flash("Success!", "success")
|
||||
return redirect(redirect_url)
|
||||
|
@ -199,8 +198,7 @@ def interpretation_edit(
|
|||
interpretation.plain_text = plain_text
|
||||
interpretation.text = text
|
||||
tags = current_app.config["TAG_REGEX"].findall(text)
|
||||
if tags:
|
||||
set_interpretation_tags(interpretation, tags)
|
||||
set_interpretation_tags(interpretation, tags)
|
||||
|
||||
log(log.INFO, "Edit interpretation [%s]", interpretation.id)
|
||||
interpretation.save()
|
||||
|
|
Loading…
Reference in New Issue