linter fix

This commit is contained in:
Alexander Karpov 2023-09-08 16:52:18 +03:00
parent 265a57ec28
commit 5f4a10a25c
9 changed files with 9 additions and 13 deletions

View File

@ -28,4 +28,3 @@ REDIS_URL=redis://redis:6379/0
# Flower # Flower
CELERY_FLOWER_USER=UXyQUejoipUYkEXdXBHQWpPqqnQYbtSb CELERY_FLOWER_USER=UXyQUejoipUYkEXdXBHQWpPqqnQYbtSb
CELERY_FLOWER_PASSWORD=r17u4eedX6PY1EsAh6l4VIGeBKh3ntAWT91mwHHZJrbgPYrekAGqHbzXsdUrJ9BJ CELERY_FLOWER_PASSWORD=r17u4eedX6PY1EsAh6l4VIGeBKh3ntAWT91mwHHZJrbgPYrekAGqHbzXsdUrJ9BJ

View File

@ -77,4 +77,3 @@ updates:
# Check for updates to GitHub Actions every weekday # Check for updates to GitHub Actions every weekday
schedule: schedule:
interval: "daily" interval: "daily"

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
!.gitkeep !.gitkeep
.idea .idea
.env
### Python template ### Python template
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files

View File

@ -2,8 +2,6 @@
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.urls import include, path 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 drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
from rest_framework.authtoken.views import obtain_auth_token from rest_framework.authtoken.views import obtain_auth_token

View File

@ -1,12 +1,12 @@
from django.db import models 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 ( from press_release_nl.common.signals import (
create_cropped_model_image, create_cropped_model_image,
delete_cropped_model_image, delete_cropped_model_image,
update_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): class BaseImageModel(models.Model):

View File

@ -7,7 +7,7 @@ def create_cropped_model_image(sender, instance, created, **kwargs):
model = sender model = sender
if created: if created:
if instance.image: if instance.image:
crop_model_image.apply_async( crop_model_image.apply_async(
kwargs={ kwargs={
"pk": instance.pk, "pk": instance.pk,
@ -16,7 +16,7 @@ def create_cropped_model_image(sender, instance, created, **kwargs):
}, },
countdown=2, countdown=2,
) )
def update_cropped_model_image(sender, instance, **kwargs): def update_cropped_model_image(sender, instance, **kwargs):
model = sender model = sender
@ -30,7 +30,7 @@ def update_cropped_model_image(sender, instance, **kwargs):
# run task to create new cropped image # run task to create new cropped image
if kwargs["update_fields"] != frozenset({"image_cropped"}) and instance: if kwargs["update_fields"] != frozenset({"image_cropped"}) and instance:
if instance.image: if instance.image:
crop_model_image.apply_async( crop_model_image.apply_async(
kwargs={ kwargs={
"pk": instance.pk, "pk": instance.pk,
@ -39,7 +39,7 @@ def update_cropped_model_image(sender, instance, **kwargs):
}, },
countdown=2, countdown=2,
) )
else: else:
instance.image_cropped = None instance.image_cropped = None

View File

@ -1,5 +1,5 @@
from django.core.cache import cache 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 django.dispatch import receiver
from press_release_nl.tickets.models import Ticket from press_release_nl.tickets.models import Ticket

View File

@ -1 +0,0 @@

View File

@ -1,6 +1,6 @@
import os import os
from io import BytesIO from io import BytesIO
from PIL import Image from PIL import Image
from press_release_nl.users.models import User from press_release_nl.users.models import User