diff --git a/HisabKitab/settings.py b/HisabKitab/settings.py index 71fd1d4..434ed98 100644 --- a/HisabKitab/settings.py +++ b/HisabKitab/settings.py @@ -9,6 +9,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ + import os from .custom_settings import * diff --git a/HisabKitab/test_settings.py b/HisabKitab/test_settings.py index 19dfe28..f224ea1 100644 --- a/HisabKitab/test_settings.py +++ b/HisabKitab/test_settings.py @@ -1,6 +1,7 @@ """ With these settings, tests run faster. """ + import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) diff --git a/HisabKitab/urls.py b/HisabKitab/urls.py index 4f56f8f..e40814a 100644 --- a/HisabKitab/urls.py +++ b/HisabKitab/urls.py @@ -13,6 +13,7 @@ 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: path(r'^blog/', include('blog.urls')) """ + from django.contrib import admin from django.contrib.auth.views import LoginView from django.urls import include, path, re_path diff --git a/HisabKitab/wsgi.py b/HisabKitab/wsgi.py index da9374d..956e4ef 100644 --- a/HisabKitab/wsgi.py +++ b/HisabKitab/wsgi.py @@ -6,6 +6,7 @@ For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ + import os from django.core.wsgi import get_wsgi_application diff --git a/users/tests/test_managers.py b/users/tests/test_managers.py index 6e3cf1a..e455a0f 100644 --- a/users/tests/test_managers.py +++ b/users/tests/test_managers.py @@ -1,4 +1,5 @@ """Tests for drf_user/managers.py module""" + from django.contrib.auth import get_user_model from django.test import TestCase from faker import Faker diff --git a/users/tests/test_utils.py b/users/tests/test_utils.py index 2861ad4..4d9b337 100644 --- a/users/tests/test_utils.py +++ b/users/tests/test_utils.py @@ -1,4 +1,5 @@ """Tests for drf_user/utils.py module""" + import datetime from unittest.mock import ANY, MagicMock, patch diff --git a/users/utils.py b/users/utils.py index d1ae9da..393ae3d 100644 --- a/users/utils.py +++ b/users/utils.py @@ -170,9 +170,9 @@ def validate_otp(value, otp): data["OTP"] = "Attempt exceeded! OTP has been reset!" else: otp_object.save() - data[ - "OTP" - ] = f"OTP Validation failed! {otp_object.validate_attempt} attempts left!" + data["OTP"] = ( + f"OTP Validation failed! {otp_object.validate_attempt} attempts left!" + ) status_code = status.HTTP_401_UNAUTHORIZED except OTPValidation.DoesNotExist: # If OTP object doesn't exist set proper message and status_code @@ -205,9 +205,9 @@ def send_otp(prop: str, value: str, otpobj: OTPValidation, recip: str) -> dict: rdata = {"success": False, "message": None} if otpobj.reactive_at > datetime.datetime.now(): - rdata[ - "message" - ] = f"OTP sending not allowed until: {otpobj.reactive_at.strftime('%d-%h-%Y %H:%M:%S')}" + rdata["message"] = ( + f"OTP sending not allowed until: {otpobj.reactive_at.strftime('%d-%h-%Y %H:%M:%S')}" + ) return rdata message = (