diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-07 14:01:55 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 14:01:55 +0530 |
commit | 7852d78515f8e108ba99dce270f58d48dce9ca5f (patch) | |
tree | ebf028184e6cdda656e885a0fd6284ba547979a9 | |
parent | 11a2e1c778cf4b2ea958b6bdd7868c8604d45df2 (diff) | |
parent | 47ac6500a959f04d5b8eeffe40499e6cefc8156c (diff) |
Merge pull request #6 from navanchauhan/deepsource-transform-10eb3717
Format code with black
-rw-r--r-- | app/tests/__init__.py | 2 | ||||
-rw-r--r-- | app/tests/test_forms.py | 4 | ||||
-rw-r--r-- | app/views/admin.py | 4 | ||||
-rw-r--r-- | app/views/main.py | 1 | ||||
-rw-r--r-- | docs/conf.py | 20 |
5 files changed, 17 insertions, 14 deletions
diff --git a/app/tests/__init__.py b/app/tests/__init__.py index 3b0e682..3e4970f 100644 --- a/app/tests/__init__.py +++ b/app/tests/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- """ PyTest Modules for Unit Testing -"""
\ No newline at end of file +""" diff --git a/app/tests/test_forms.py b/app/tests/test_forms.py index 0f772b3..ebfee8a 100644 --- a/app/tests/test_forms.py +++ b/app/tests/test_forms.py @@ -4,6 +4,8 @@ Test(s) for Forms Tests the forms and their validations """ + + def test_incorrect_forms(app, client): """ Simulate Invalid Forms @@ -19,7 +21,7 @@ def test_incorrect_forms(app, client): def test_contactus(app, client): - """Test Valid Form Submission""" + """Test Valid Form Submission""" res = client.post( "/ContactUs", data={ diff --git a/app/views/admin.py b/app/views/admin.py index 8588e87..56014a0 100644 --- a/app/views/admin.py +++ b/app/views/admin.py @@ -15,6 +15,7 @@ admin = Admin(app, name="Admin", template_mode="bootstrap4") Initialised Admin Portal """ + class ModelView(ModelView): # skipcq: PYL-E0102 """ Our extended ModelView Class @@ -23,6 +24,7 @@ class ModelView(ModelView): # skipcq: PYL-E0102 https://flask-admin.readthedocs.io/en/latest/introduction/?highlight=ModelView#modelview-configuration-attributes """ + def is_accessible(self): """This function checks if a user should be given access or not""" try: @@ -33,4 +35,4 @@ class ModelView(ModelView): # skipcq: PYL-E0102 return False -admin.add_view(ModelView(User, db.session))
\ No newline at end of file +admin.add_view(ModelView(User, db.session)) diff --git a/app/views/main.py b/app/views/main.py index d4d94e9..308c6ac 100644 --- a/app/views/main.py +++ b/app/views/main.py @@ -11,6 +11,7 @@ from flask import render_template, flash from app.views import auth, error_pages, admin from app.misc_func import flash_errors + @app.route("/") @app.route("/index") def index(): diff --git a/docs/conf.py b/docs/conf.py index 357ba4b..102d908 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,12 +17,12 @@ # -- Project information ----------------------------------------------------- -project = 'SaaS in a Flask' -copyright = '2021, Navan Chauhan' -author = 'Navan Chauhan' +project = "SaaS in a Flask" +copyright = "2021, Navan Chauhan" +author = "Navan Chauhan" # The full version, including alpha/beta/rc tags -release = '0.1.0' +release = "0.1.0" # -- General configuration --------------------------------------------------- @@ -30,19 +30,17 @@ release = '0.1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [ - "autoapi.extension" -] +extensions = ["autoapi.extension"] autoapi_dirs = ["../app"] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- @@ -50,9 +48,9 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = "alabaster" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static']
\ No newline at end of file +html_static_path = ["_static"] |