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