fix: fix 'no-else-return' for pylint
This commit is contained in:
parent
6424432f1b
commit
fdeb0eeeb2
4 changed files with 32 additions and 34 deletions
|
@ -4,6 +4,7 @@
|
||||||
disable=all
|
disable=all
|
||||||
enable=
|
enable=
|
||||||
inconsistent-return-statements,
|
inconsistent-return-statements,
|
||||||
|
no-else-return,
|
||||||
too-many-branches,
|
too-many-branches,
|
||||||
too-many-instance-attributes,
|
too-many-instance-attributes,
|
||||||
too-many-return-statements,
|
too-many-return-statements,
|
||||||
|
|
|
@ -401,57 +401,57 @@ def get_liburl( # pylint: disable=too-many-return-statements,too-many-branches
|
||||||
return liburl + static.buefy_js.relpath
|
return liburl + static.buefy_js.relpath
|
||||||
return f"https://unpkg.com/buefy@{version}/dist/buefy.min.js"
|
return f"https://unpkg.com/buefy@{version}/dist/buefy.min.js"
|
||||||
|
|
||||||
elif key == "buefy.css":
|
if key == "buefy.css":
|
||||||
if static and hasattr(static, "buefy_css"):
|
if static and hasattr(static, "buefy_css"):
|
||||||
return liburl + static.buefy_css.relpath
|
return liburl + static.buefy_css.relpath
|
||||||
return f"https://unpkg.com/buefy@{version}/dist/buefy.min.css"
|
return f"https://unpkg.com/buefy@{version}/dist/buefy.min.css"
|
||||||
|
|
||||||
elif key == "vue":
|
if key == "vue":
|
||||||
if static and hasattr(static, "vue_js"):
|
if static and hasattr(static, "vue_js"):
|
||||||
return liburl + static.vue_js.relpath
|
return liburl + static.vue_js.relpath
|
||||||
return f"https://unpkg.com/vue@{version}/dist/vue.min.js"
|
return f"https://unpkg.com/vue@{version}/dist/vue.min.js"
|
||||||
|
|
||||||
elif key == "vue_resource":
|
if key == "vue_resource":
|
||||||
if static and hasattr(static, "vue_resource_js"):
|
if static and hasattr(static, "vue_resource_js"):
|
||||||
return liburl + static.vue_resource_js.relpath
|
return liburl + static.vue_resource_js.relpath
|
||||||
return f"https://cdn.jsdelivr.net/npm/vue-resource@{version}"
|
return f"https://cdn.jsdelivr.net/npm/vue-resource@{version}"
|
||||||
|
|
||||||
elif key == "fontawesome":
|
if key == "fontawesome":
|
||||||
if static and hasattr(static, "fontawesome_js"):
|
if static and hasattr(static, "fontawesome_js"):
|
||||||
return liburl + static.fontawesome_js.relpath
|
return liburl + static.fontawesome_js.relpath
|
||||||
return f"https://use.fontawesome.com/releases/v{version}/js/all.js"
|
return f"https://use.fontawesome.com/releases/v{version}/js/all.js"
|
||||||
|
|
||||||
elif key == "bb_vue":
|
if key == "bb_vue":
|
||||||
if static and hasattr(static, "bb_vue_js"):
|
if static and hasattr(static, "bb_vue_js"):
|
||||||
return liburl + static.bb_vue_js.relpath
|
return liburl + static.bb_vue_js.relpath
|
||||||
return f"https://unpkg.com/vue@{version}/dist/vue.esm-browser.prod.js"
|
return f"https://unpkg.com/vue@{version}/dist/vue.esm-browser.prod.js"
|
||||||
|
|
||||||
elif key == "bb_oruga":
|
if key == "bb_oruga":
|
||||||
if static and hasattr(static, "bb_oruga_js"):
|
if static and hasattr(static, "bb_oruga_js"):
|
||||||
return liburl + static.bb_oruga_js.relpath
|
return liburl + static.bb_oruga_js.relpath
|
||||||
return f"https://unpkg.com/@oruga-ui/oruga-next@{version}/dist/oruga.mjs"
|
return f"https://unpkg.com/@oruga-ui/oruga-next@{version}/dist/oruga.mjs"
|
||||||
|
|
||||||
elif key == "bb_oruga_bulma":
|
if key == "bb_oruga_bulma":
|
||||||
if static and hasattr(static, "bb_oruga_bulma_js"):
|
if static and hasattr(static, "bb_oruga_bulma_js"):
|
||||||
return liburl + static.bb_oruga_bulma_js.relpath
|
return liburl + static.bb_oruga_bulma_js.relpath
|
||||||
return f"https://unpkg.com/@oruga-ui/theme-bulma@{version}/dist/bulma.js"
|
return f"https://unpkg.com/@oruga-ui/theme-bulma@{version}/dist/bulma.js"
|
||||||
|
|
||||||
elif key == "bb_oruga_bulma_css":
|
if key == "bb_oruga_bulma_css":
|
||||||
if static and hasattr(static, "bb_oruga_bulma_css"):
|
if static and hasattr(static, "bb_oruga_bulma_css"):
|
||||||
return liburl + static.bb_oruga_bulma_css.relpath
|
return liburl + static.bb_oruga_bulma_css.relpath
|
||||||
return f"https://unpkg.com/@oruga-ui/theme-bulma@{version}/dist/bulma.css"
|
return f"https://unpkg.com/@oruga-ui/theme-bulma@{version}/dist/bulma.css"
|
||||||
|
|
||||||
elif key == "bb_fontawesome_svg_core":
|
if key == "bb_fontawesome_svg_core":
|
||||||
if static and hasattr(static, "bb_fontawesome_svg_core_js"):
|
if static and hasattr(static, "bb_fontawesome_svg_core_js"):
|
||||||
return liburl + static.bb_fontawesome_svg_core_js.relpath
|
return liburl + static.bb_fontawesome_svg_core_js.relpath
|
||||||
return f"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-svg-core@{version}/+esm"
|
return f"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-svg-core@{version}/+esm"
|
||||||
|
|
||||||
elif key == "bb_free_solid_svg_icons":
|
if key == "bb_free_solid_svg_icons":
|
||||||
if static and hasattr(static, "bb_free_solid_svg_icons_js"):
|
if static and hasattr(static, "bb_free_solid_svg_icons_js"):
|
||||||
return liburl + static.bb_free_solid_svg_icons_js.relpath
|
return liburl + static.bb_free_solid_svg_icons_js.relpath
|
||||||
return f"https://cdn.jsdelivr.net/npm/@fortawesome/free-solid-svg-icons@{version}/+esm"
|
return f"https://cdn.jsdelivr.net/npm/@fortawesome/free-solid-svg-icons@{version}/+esm"
|
||||||
|
|
||||||
elif key == "bb_vue_fontawesome":
|
if key == "bb_vue_fontawesome":
|
||||||
if static and hasattr(static, "bb_vue_fontawesome_js"):
|
if static and hasattr(static, "bb_vue_fontawesome_js"):
|
||||||
return liburl + static.bb_vue_fontawesome_js.relpath
|
return liburl + static.bb_vue_fontawesome_js.relpath
|
||||||
return (
|
return (
|
||||||
|
@ -581,7 +581,7 @@ def make_json_safe(value, key=None, warn=True):
|
||||||
if value is colander.null:
|
if value is colander.null:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
elif isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
# recursively convert dict
|
# recursively convert dict
|
||||||
parent = dict(value)
|
parent = dict(value)
|
||||||
for key, value in parent.items():
|
for key, value in parent.items():
|
||||||
|
|
|
@ -86,7 +86,6 @@ class AuthView(View):
|
||||||
headers = login_user(self.request, user)
|
headers = login_user(self.request, user)
|
||||||
return self.redirect(referrer, headers=headers)
|
return self.redirect(referrer, headers=headers)
|
||||||
|
|
||||||
else:
|
|
||||||
self.request.session.flash("Invalid user credentials", "error")
|
self.request.session.flash("Invalid user credentials", "error")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -483,7 +483,7 @@ class MasterView(View):
|
||||||
context["pager_stats"] = grid.get_vue_pager_stats()
|
context["pager_stats"] = grid.get_vue_pager_stats()
|
||||||
return self.json_response(context)
|
return self.json_response(context)
|
||||||
|
|
||||||
else: # full, not partial
|
# full, not partial
|
||||||
|
|
||||||
# nb. when user asks to reset view, it is via the query
|
# nb. when user asks to reset view, it is via the query
|
||||||
# string. if so we then redirect to discard that.
|
# string. if so we then redirect to discard that.
|
||||||
|
@ -801,8 +801,6 @@ class MasterView(View):
|
||||||
self.delete_bulk_action(data)
|
self.delete_bulk_action(data)
|
||||||
return self.redirect(self.get_index_url())
|
return self.redirect(self.get_index_url())
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
# start thread for delete; show progress page
|
# start thread for delete; show progress page
|
||||||
route_prefix = self.get_route_prefix()
|
route_prefix = self.get_route_prefix()
|
||||||
key = f"{route_prefix}.delete_bulk"
|
key = f"{route_prefix}.delete_bulk"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue