Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 5, 2024
1 parent 2da6ebd commit df2a6cb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions HisabKitab/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
1 change: 1 addition & 0 deletions HisabKitab/test_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
With these settings, tests run faster.
"""

import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down
1 change: 1 addition & 0 deletions HisabKitab/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions HisabKitab/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions users/tests/test_managers.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions users/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for drf_user/utils.py module"""

import datetime
from unittest.mock import ANY, MagicMock, patch

Expand Down
12 changes: 6 additions & 6 deletions users/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = (
Expand Down

0 comments on commit df2a6cb

Please sign in to comment.