Skip to content

Commit 13f157a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent abdb668 commit 13f157a

21 files changed

+37
-38
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ cython_debug/
162162

163163
# django static files
164164
staticfiles/
165-
static/CACHE/
165+
static/CACHE/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ repos:
2020
- id: trailing-whitespace
2121
- id: end-of-file-fixer
2222
- id: debug-statements
23-
- id: requirements-txt-fixer
23+
- id: requirements-txt-fixer

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
66

77
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
88

9-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ migrate:
1010

1111
migrations:
1212
@echo "Creating migration..."
13-
python manage.py makemigrations
13+
python manage.py makemigrations

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Transaction page:
1818
## TODO: update this file with more details
1919

2020
What's left to do:
21-
Check [TODO.md](TODO.md)
21+
Check [TODO.md](TODO.md)

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
- 3 Failed attempts and block user for 24 hours.
55
- Throttle OTP generation
66
- OTP support via third party services
7-
- Support multiple offers with expiry and use the latest offer to give points
7+
- Support multiple offers with expiry and use the latest offer to give points

accounts/admin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ class OTPValidationAdmin(admin.ModelAdmin):
1616
list_display = ("destination", "otp", "valid_until", "is_validated")
1717
list_filter = ("is_validated",)
1818
search_fields = ("destination",)
19-

manage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def main():
88
"""Run administrative tasks."""
9-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rewardme.settings')
9+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rewardme.settings")
1010
try:
1111
from django.core.management import execute_from_command_line
1212
except ImportError as exc:
@@ -18,5 +18,5 @@ def main():
1818
execute_from_command_line(sys.argv)
1919

2020

21-
if __name__ == '__main__':
21+
if __name__ == "__main__":
2222
main()

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Django==4.1.5
22
django-compressor==4.1
3+
django-environ==0.9.0
34
django-extensions==3.2.1
5+
django-flags==5.0.12
46
django-htmx==1.13.0
57
django-simple-history==3.2.0
68
django-sms==0.6.0
79
djangorestframework==3.14.0
10+
pre-commit==2.21.0
811
pytailwindcss==0.1.4
912
requests==2.28.1
10-
pre-commit==2.21.0
11-
django-environ==0.9.0
12-
django-flags==5.0.12
13-
sentry-sdk==1.13.0
13+
sentry-sdk==1.13.0

rewardme/settings.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
https://docs.djangoproject.com/en/4.1/ref/settings/
1111
"""
1212

13-
1413
import os
1514
from pathlib import Path
1615

@@ -28,16 +27,16 @@
2827
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
2928

3029
# Take environment variables from .env file
31-
environ.Env.read_env(os.path.join(BASE_DIR, '.env'))
30+
environ.Env.read_env(os.path.join(BASE_DIR, ".env"))
3231

3332
# SECURITY WARNING: keep the secret key used in production secret!
34-
SECRET_KEY = env('SECRET_KEY')
33+
SECRET_KEY = env("SECRET_KEY")
3534

3635
# SECURITY WARNING: don't run with debug turned on in production!
37-
DEBUG = env('DEBUG')
36+
DEBUG = env("DEBUG")
3837

39-
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
40-
CSRF_TRUSTED_ORIGINS = env.list('CSRF_TRUSTED_ORIGINS')
38+
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")
39+
CSRF_TRUSTED_ORIGINS = env.list("CSRF_TRUSTED_ORIGINS")
4140

4241
# Application definition
4342

@@ -100,7 +99,7 @@
10099

101100
WSGI_APPLICATION = "rewardme.wsgi.application"
102101

103-
if USE_SQLITE := env('USE_SQLITE'):
102+
if USE_SQLITE := env("USE_SQLITE"):
104103
DATABASES = {
105104
"default": {
106105
"ENGINE": "django.db.backends.sqlite3",
@@ -110,7 +109,7 @@
110109
else:
111110
DATABASES = {
112111
"default": {
113-
'ENGINE': 'django.db.backends.postgresql',
112+
"ENGINE": "django.db.backends.postgresql",
114113
"NAME": env("DB_NAME"),
115114
"USER": env("DB_USER"),
116115
"PASSWORD": env("DB_PASSWORD"),
@@ -159,9 +158,9 @@
159158
STATIC_ROOT = BASE_DIR / "staticfiles"
160159
COMPRESS_ENABLED = True
161160
STATICFILES_FINDERS = (
162-
'django.contrib.staticfiles.finders.FileSystemFinder',
163-
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
164-
'compressor.finders.CompressorFinder',
161+
"django.contrib.staticfiles.finders.FileSystemFinder",
162+
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
163+
"compressor.finders.CompressorFinder",
165164
)
166165

167166
# Default primary key field type
@@ -185,14 +184,14 @@
185184
)
186185

187186
# Sentry
188-
if USE_SENTRY := env.bool('USE_SENTRY', default=False):
187+
if USE_SENTRY := env.bool("USE_SENTRY", default=False):
189188
import sentry_sdk
190189
from sentry_sdk.integrations.django import DjangoIntegration
191190

192191
sentry_sdk.init(
193-
dsn=env('SENTRY_DSN'),
192+
dsn=env("SENTRY_DSN"),
194193
integrations=[DjangoIntegration()],
195-
traces_sample_rate=env.float('SENTRY_TRACES_SAMPLE_RATE', default=0.1),
194+
traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE", default=0.1),
196195
send_default_pii=True,
197-
release=env('SENTRY_RELEASE'),
196+
release=env("SENTRY_RELEASE"),
198197
)

0 commit comments

Comments
 (0)