diff --git a/aleksis/core/apps.py b/aleksis/core/apps.py index 4f243858d97bb458b59c03ddb99ba67fd771a0c2..0037842bc71590eb521aa67f25b5f4cc6b50fb92 100644 --- a/aleksis/core/apps.py +++ b/aleksis/core/apps.py @@ -2,7 +2,6 @@ from typing import Any, List, Optional, Tuple import django.apps from django.http import HttpRequest -from django.core.files.uploadedfile import TemporaryUploadedFile from dynamic_preferences.registries import preference_models @@ -65,7 +64,7 @@ class CoreConfig(AppConfig): if new_value: Favicon.on_site.update_or_create( title=name, - defaults={"isFavicon": name == "favicon", "faviconImage": new_value, }, + defaults={"isFavicon": name == "favicon", "faviconImage": new_value,}, ) else: Favicon.on_site.filter(title=name, isFavicon=is_favicon).delete() diff --git a/aleksis/core/mixins.py b/aleksis/core/mixins.py index ca5ffc85552ebe4267b4c7cf0a6d93bb0df7b7ef..b6ae0b04cda77bca46ddfe7af53943086c8d5b38 100644 --- a/aleksis/core/mixins.py +++ b/aleksis/core/mixins.py @@ -1,3 +1,5 @@ +# flake8: noqa: DJ12 + from datetime import datetime from typing import Any, Callable, List, Optional, Tuple, Union diff --git a/aleksis/core/models.py b/aleksis/core/models.py index 6f4fff67654ff11857a56c25c6cb89fbedf0833c..b5bb204c25139c463e6d53c27b7c1ddf51b75576 100644 --- a/aleksis/core/models.py +++ b/aleksis/core/models.py @@ -1,3 +1,5 @@ +# flake8: noqa: DJ01 + from datetime import date, datetime from typing import Iterable, List, Optional, Sequence, Union @@ -81,7 +83,7 @@ class Person(ExtensibleModel): ) short_name = models.CharField( - verbose_name=_("Short name"), max_length=255, blank=True, null=True, unique=True # noqa + verbose_name=_("Short name"), max_length=255, blank=True, null=True, unique=True # noqa ) street = models.CharField(verbose_name=_("Street"), max_length=255, blank=True) @@ -151,16 +153,15 @@ class Person(ExtensibleModel): @property def mail_sender(self) -> str: """E-mail sender in "Name <email>" format.""" - return f"\"{self.addressing_name}\" <{self.email}>" + return f'"{self.addressing_name}" <{self.email}>' @property def mail_sender_via(self) -> str: """E-mail sender for via addresses, in "Name via Site <email>" format.""" - site_mail = get_site_preferences()["mail__address"] site_name = get_site_preferences()["general__title"] - return f"\"{self.addressing_name} via {site_name}\" <{site_mail}>" + return f'"{self.addressing_name} via {site_name}" <{site_mail}>' @property def age(self): @@ -271,7 +272,7 @@ class Group(ExtensibleModel): name = models.CharField(verbose_name=_("Long name"), max_length=255, unique=True) short_name = models.CharField( - verbose_name=_("Short name"), max_length=255, unique=True, blank=True, null=True # noqa + verbose_name=_("Short name"), max_length=255, unique=True, blank=True, null=True # noqa ) members = models.ManyToManyField( diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index e6da76d828a0a8c8bd3320ac748c98e87bf5c973..fba3dc3c1f6b934645a8b0cf0b97814de0be0bbd 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -653,3 +653,5 @@ else: HAYSTACK_SIGNAL_PROCESSOR = "haystack.signals.RealtimeSignalProcessor" HAYSTACK_SEARCH_RESULTS_PER_PAGE = 10 + +DJANGO_EASY_AUDIT_WATCH_REQUEST_EVENTS = False diff --git a/aleksis/core/templatetags/html_helpers.py b/aleksis/core/templatetags/html_helpers.py index 77b198f3f2cf7eff0a48ec39fb2924db8c047840..a30a230ce4f9aebdf93499ef8ff511befe2a8871 100644 --- a/aleksis/core/templatetags/html_helpers.py +++ b/aleksis/core/templatetags/html_helpers.py @@ -11,7 +11,6 @@ def add_class_to_el(value: str, arg: str) -> str: Example: {{ mymodel.myhtmlfield|add_class_to_el:"ul,browser-default" """ - el, cls = arg.split(",") soup = BeautifulSoup(value, "html.parser") diff --git a/aleksis/core/util/core_helpers.py b/aleksis/core/util/core_helpers.py index 67c9daae584fbdbe84294b8439d7cfb20481aa01..522b930d4c73286051b829cb001d33fa49908fcd 100644 --- a/aleksis/core/util/core_helpers.py +++ b/aleksis/core/util/core_helpers.py @@ -228,6 +228,6 @@ def objectgetter_optional( if id_ is not None: return get_object_or_404(model, pk=id_) else: - return eval(default) if default_eval else default + return eval(default) if default_eval else default # noqa:S307 return get_object diff --git a/aleksis/core/util/search.py b/aleksis/core/util/search.py index 22abef17c59d667f0954eb22c15dbab71b64aae2..5c8af9f860df94649d46f1fc0dd0741e35c6ad07 100644 --- a/aleksis/core/util/search.py +++ b/aleksis/core/util/search.py @@ -6,9 +6,9 @@ from haystack import indexes Indexable = indexes.Indexable # noqa if settings.HAYSTACK_SIGNAL_PROCESSOR == "celery_haystack.signals.CelerySignalProcessor": - from haystack.indexes import SearchIndex as BaseSearchIndex -else: from celery_haystack.indexes import CelerySearchIndex as BaseSearchIndex +else: + from haystack.indexes import SearchIndex as BaseSearchIndex class SearchIndex(BaseSearchIndex): diff --git a/apps/official/AlekSIS-App-Chronos b/apps/official/AlekSIS-App-Chronos index 5794ef636b70c617cca8e2ed14ed0f8ff0b038d9..92d8f90e75e2fff730875d98b58c482b8f9e0363 160000 --- a/apps/official/AlekSIS-App-Chronos +++ b/apps/official/AlekSIS-App-Chronos @@ -1 +1 @@ -Subproject commit 5794ef636b70c617cca8e2ed14ed0f8ff0b038d9 +Subproject commit 92d8f90e75e2fff730875d98b58c482b8f9e0363 diff --git a/apps/official/AlekSIS-App-DashboardFeeds b/apps/official/AlekSIS-App-DashboardFeeds index 83d471417a1e1b9e4ed693a66291163b900240ba..ecc06365dd1aa3c87663044864a3bb1cde978777 160000 --- a/apps/official/AlekSIS-App-DashboardFeeds +++ b/apps/official/AlekSIS-App-DashboardFeeds @@ -1 +1 @@ -Subproject commit 83d471417a1e1b9e4ed693a66291163b900240ba +Subproject commit ecc06365dd1aa3c87663044864a3bb1cde978777 diff --git a/apps/official/AlekSIS-App-Hjelp b/apps/official/AlekSIS-App-Hjelp index fce4605a878e073ce883d4b0abe7194d0ce2f554..4bc8252c6b1ccc67e9a05767c837a4bb04e11a50 160000 --- a/apps/official/AlekSIS-App-Hjelp +++ b/apps/official/AlekSIS-App-Hjelp @@ -1 +1 @@ -Subproject commit fce4605a878e073ce883d4b0abe7194d0ce2f554 +Subproject commit 4bc8252c6b1ccc67e9a05767c837a4bb04e11a50 diff --git a/apps/official/AlekSIS-App-LDAP b/apps/official/AlekSIS-App-LDAP index 352b2391bc1cf5bfb5ab7420af77b5657d325c1a..4d485ae182f2dce869cd68aa0879744b26ed3e19 160000 --- a/apps/official/AlekSIS-App-LDAP +++ b/apps/official/AlekSIS-App-LDAP @@ -1 +1 @@ -Subproject commit 352b2391bc1cf5bfb5ab7420af77b5657d325c1a +Subproject commit 4d485ae182f2dce869cd68aa0879744b26ed3e19 diff --git a/apps/official/AlekSIS-App-Untis b/apps/official/AlekSIS-App-Untis index e66f07400539b7e0c948cb35f7c460387e3d0a89..32395aeaefc1a999b5290fc07095ba79629113f7 160000 --- a/apps/official/AlekSIS-App-Untis +++ b/apps/official/AlekSIS-App-Untis @@ -1 +1 @@ -Subproject commit e66f07400539b7e0c948cb35f7c460387e3d0a89 +Subproject commit 32395aeaefc1a999b5290fc07095ba79629113f7 diff --git a/poetry.lock b/poetry.lock index 1b9b5c539330f52262e046100473213c08f5877b..75f8cb1a9437013dc662cfc89045e6f9f4269312 100644 --- a/poetry.lock +++ b/poetry.lock @@ -222,10 +222,11 @@ description = "An app for integrating Celery with Haystack." name = "celery-haystack" optional = true python-versions = "*" -version = "0.3.1" +version = "0.7.2" [package.dependencies] -django-appconf = ">=0.2.1" +django-appconf = ">=0.4.1" +django-celery-transactions = ">=0.1.2" [[package]] category = "main" @@ -424,6 +425,18 @@ version = "1.2.1" [package.dependencies] celery = ">=4.4,<5.0" +[[package]] +category = "main" +description = "Django transaction support for Celery tasks." +name = "django-celery-transactions" +optional = true +python-versions = "*" +version = "0.3.6" + +[package.dependencies] +Django = ">=1.2.4" +celery = ">=2.2.7" + [[package]] category = "main" description = "Django admin CKEditor integration." @@ -485,7 +498,6 @@ six = "*" reference = "7bee176d6a832c200d255bcd1e9d12c85cb1d4f8" type = "git" url = "https://github.com/hansegucker/django-dynamic-preferences" - [[package]] category = "main" description = "Yet another Django audit log app, hopefully the simplest one." @@ -703,6 +715,10 @@ version = "3.0.1" Django = ">=1.11.3" babel = "*" +[package.dependencies.phonenumbers] +optional = true +version = ">=7.0.2" + [package.extras] phonenumbers = ["phonenumbers (>=7.0.2)"] phonenumberslite = ["phonenumberslite (>=7.0.2)"] @@ -2120,7 +2136,7 @@ celery = ["Celery", "django-celery-results", "django-celery-beat", "django-celer ldap = ["django-auth-ldap"] [metadata] -content-hash = "08a5c2dd2f9c67d2148f46157d7ca0b2694aa9e4fe719c5a313a02a14852ee7f" +content-hash = "87813ab4f21b0c03f2150f7569c65fd6c8a29297d0585db468fcbcddb2e15a58" python-versions = "^3.7" [metadata.files] @@ -2186,7 +2202,7 @@ celery = [ {file = "celery-4.4.2.tar.gz", hash = "sha256:108a0bf9018a871620936c33a3ee9f6336a89f8ef0a0f567a9001f4aa361415f"}, ] celery-haystack = [ - {file = "celery-haystack-0.3.1.tar.gz", hash = "sha256:49992712e67b1f39afd294dca6ba2820f2d262b3137ad14cb0c57a05fa218725"}, + {file = "celery-haystack-0.7.2.tar.gz", hash = "sha256:5ee3dfb9d5c1b0cf13b5a8e38cf3cbbde9009fe4470042f3087485743b6971fb"}, ] certifi = [ {file = "certifi-2020.4.5.1-py2.py3-none-any.whl", hash = "sha256:1d987a998c75633c40847cc966fcf5904906c920a7f17ef374f5aa4282abd304"}, @@ -2287,6 +2303,9 @@ django-celery-results = [ {file = "django_celery_results-1.2.1-py2.py3-none-any.whl", hash = "sha256:a29ab580f0e38c66c39f51cc426bbdbb2a391b8cc0867df9dea748db2c961db2"}, {file = "django_celery_results-1.2.1.tar.gz", hash = "sha256:e390f70cc43bbc2cd7c8e4607dc29ab6211a2ab968f93677583f0160921f670c"}, ] +django-celery-transactions = [ + {file = "django-celery-transactions-0.3.6.tar.gz", hash = "sha256:cdf966ec461e9ec736a7bedcf47cb219fc79ea86f2b39191cb258082dd4f4b33"}, +] django-ckeditor = [ {file = "django-ckeditor-5.9.0.tar.gz", hash = "sha256:e4d112851a72c5bf8b586e1c674d34084cab16d28f2553ad15cc770d1e9639c7"}, {file = "django_ckeditor-5.9.0-py2.py3-none-any.whl", hash = "sha256:71c3c7bb46b0cbfb9712ef64af0d2a406eab233f44ecd7c42c24bdfa39ae3bde"}, diff --git a/pyproject.toml b/pyproject.toml index 88d723304a33a40d4b77c13547a41700d20f8243..3b5df38de670b15cf427234a3824e15bd2f545e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,7 @@ django-guardian = "^2.2.0" rules = "^2.2" django-cache-memoize = "^0.1.6" django-haystack = {version="3.0b1", allow-prereleases = true} -celery-haystack = {version="^0.3.1", optional=true} +celery-haystack = {version="^0.7.0", optional=true} django-dbbackup = "^3.3.0" spdx-license-list = "^0.4.0" license-expression = "^1.2" diff --git a/tox.ini b/tox.ini index 01f52ced6522ebc60ae94feeb3664ff5326ba1a5..37001fc0afe779baef04b144603769c1255501cb 100644 --- a/tox.ini +++ b/tox.ini @@ -48,7 +48,7 @@ commands = [flake8] max_line_length = 100 exclude = migrations,tests -ignore = BLK100,E203,E231,W503,D100,D101,D102,D103,D104,D105,D106,D107,RST215,RST214,F821,F841,S106,T100,T101 +ignore = BLK100,E203,E231,W503,D100,D101,D102,D103,D104,D105,D106,D107,RST215,RST214,F821,F841,S106,T100,T101,DJ05 [isort] line_length = 100