fix comments

This commit is contained in:
Kostiantyn Stoliarskyi 2023-05-01 17:29:54 +03:00
parent aa8bd25b35
commit 3169b251c0
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,6 @@
from flask import url_for
from flask_login import current_user
from app import models as m, db
from app import schema as s
@ -52,7 +53,7 @@ def create_breadcrumbs(
label=collection.label,
)
]
if section_id != 0 and collection_path:
if section_id and collection_path:
section: m.Section = db.session.get(m.Section, section_id)
if len(collection_path) == 2:
crumples += [
@ -80,7 +81,7 @@ def create_breadcrumbs(
label=section.label,
)
]
if interpretation_id != 0:
if interpretation_id:
interpretation: m.Interpretation = db.session.get(
m.Interpretation, interpretation_id
)

View File

@ -8,9 +8,8 @@ from flask import (
)
from flask_login import login_required, current_user
from app.controllers import create_pagination
from app.controllers import create_pagination, create_breadcrumbs
from app import models as m, db, forms as f
from app.controllers.breadcrumbs import create_breadcrumbs
from app.logger import log
bp = Blueprint("book", __name__, url_prefix="/book")