From 47ac6500a959f04d5b8eeffe40499e6cefc8156c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 7 Jun 2021 08:29:43 +0000 Subject: Format code with black This commit fixes the style issues introduced in 11a2e1c according to the output from black. Details: https://deepsource.io/gh/navanchauhan/SaaS-in-a-Flask/transform/5a6278fb-7606-43ba-b4b5-8c059152a84c/ --- app/tests/__init__.py | 2 +- app/tests/test_forms.py | 4 +++- app/views/admin.py | 4 +++- app/views/main.py | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'app') 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(): -- cgit v1.2.3