From 5f4a10a25c7272c9b813997fab44467a9101e4a4 Mon Sep 17 00:00:00 2001 From: Alexander-D-Karpov Date: Fri, 8 Sep 2023 16:52:18 +0300 Subject: [PATCH] linter fix --- .envs/.production/.django | 1 - .github/dependabot.yml | 1 - .gitignore | 1 + config/urls.py | 2 -- press_release_nl/common/models.py | 4 ++-- press_release_nl/common/signals.py | 8 ++++---- press_release_nl/tickets/signals.py | 2 +- press_release_nl/users/views.py | 1 - press_release_nl/utils/files.py | 2 +- 9 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.envs/.production/.django b/.envs/.production/.django index 6cb4dd6..5038a2a 100644 --- a/.envs/.production/.django +++ b/.envs/.production/.django @@ -28,4 +28,3 @@ REDIS_URL=redis://redis:6379/0 # Flower CELERY_FLOWER_USER=UXyQUejoipUYkEXdXBHQWpPqqnQYbtSb CELERY_FLOWER_PASSWORD=r17u4eedX6PY1EsAh6l4VIGeBKh3ntAWT91mwHHZJrbgPYrekAGqHbzXsdUrJ9BJ - diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 417b5ac..98a0de6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -77,4 +77,3 @@ updates: # Check for updates to GitHub Actions every weekday schedule: interval: "daily" - diff --git a/.gitignore b/.gitignore index 0b35de0..10e1894 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ !.gitkeep .idea +.env ### Python template # Byte-compiled / optimized / DLL files diff --git a/config/urls.py b/config/urls.py index d47b689..f2713b4 100644 --- a/config/urls.py +++ b/config/urls.py @@ -2,8 +2,6 @@ from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path -from django.views import defaults as default_views -from django.views.generic import TemplateView from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView from rest_framework.authtoken.views import obtain_auth_token diff --git a/press_release_nl/common/models.py b/press_release_nl/common/models.py index c4ea3f8..e3b9962 100644 --- a/press_release_nl/common/models.py +++ b/press_release_nl/common/models.py @@ -1,12 +1,12 @@ from django.db import models -from press_release_nl.utils.files import user_file_upload_mixin -from press_release_nl.utils.generators import generate_charset from press_release_nl.common.signals import ( create_cropped_model_image, delete_cropped_model_image, update_cropped_model_image, ) +from press_release_nl.utils.files import user_file_upload_mixin +from press_release_nl.utils.generators import generate_charset class BaseImageModel(models.Model): diff --git a/press_release_nl/common/signals.py b/press_release_nl/common/signals.py index b06501d..2cc7c7c 100644 --- a/press_release_nl/common/signals.py +++ b/press_release_nl/common/signals.py @@ -7,7 +7,7 @@ def create_cropped_model_image(sender, instance, created, **kwargs): model = sender if created: if instance.image: - + crop_model_image.apply_async( kwargs={ "pk": instance.pk, @@ -16,7 +16,7 @@ def create_cropped_model_image(sender, instance, created, **kwargs): }, countdown=2, ) - + def update_cropped_model_image(sender, instance, **kwargs): model = sender @@ -30,7 +30,7 @@ def update_cropped_model_image(sender, instance, **kwargs): # run task to create new cropped image if kwargs["update_fields"] != frozenset({"image_cropped"}) and instance: if instance.image: - + crop_model_image.apply_async( kwargs={ "pk": instance.pk, @@ -39,7 +39,7 @@ def update_cropped_model_image(sender, instance, **kwargs): }, countdown=2, ) - + else: instance.image_cropped = None diff --git a/press_release_nl/tickets/signals.py b/press_release_nl/tickets/signals.py index c78e5de..9eeb84d 100644 --- a/press_release_nl/tickets/signals.py +++ b/press_release_nl/tickets/signals.py @@ -1,5 +1,5 @@ from django.core.cache import cache -from django.db.models.signals import post_save, post_delete, pre_save +from django.db.models.signals import post_delete, post_save, pre_save from django.dispatch import receiver from press_release_nl.tickets.models import Ticket diff --git a/press_release_nl/users/views.py b/press_release_nl/users/views.py index 8b13789..e69de29 100644 --- a/press_release_nl/users/views.py +++ b/press_release_nl/users/views.py @@ -1 +0,0 @@ - diff --git a/press_release_nl/utils/files.py b/press_release_nl/utils/files.py index 1ef1a3c..b05e952 100644 --- a/press_release_nl/utils/files.py +++ b/press_release_nl/utils/files.py @@ -1,6 +1,6 @@ import os - from io import BytesIO + from PIL import Image from press_release_nl.users.models import User