Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
exclude: .+/migrations/.+\.py
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: trailing-whitespace
Expand All @@ -15,7 +15,7 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: [ "--profile", "black" ]
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
Loading