Skip to content

Commit

Permalink
Merge pull request #3218 from open-formulieren/chore/3049-upgrade-dep…
Browse files Browse the repository at this point in the history
…endencies

Upgrade dependencies
  • Loading branch information
sergei-maertens authored Jul 5, 2023
2 parents 1f912c0 + 73ea9d7 commit 625a474
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 104 deletions.
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ frozendict
django ~= 3.2.0
django-admin-index
django-autoslug
django-axes
django-axes[ipware]
django-better-admin-arrayfield
django-camunda
django-capture-tag
Expand Down
9 changes: 4 additions & 5 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ celery==5.2.7
# via
# -r requirements/base.in
# celery-once
# django-yubin
# flower
celery-once==3.0.1
# via -r requirements/base.in
Expand Down Expand Up @@ -136,7 +137,7 @@ django-appconf==1.0.4
# django-timeline-logger
django-autoslug==1.9.9
# via -r requirements/base.in
django-axes==5.31.0
django-axes[ipware]==6.0.5
# via -r requirements/base.in
django-better-admin-arrayfield==1.4.2
# via
Expand Down Expand Up @@ -166,7 +167,7 @@ django-formtools==2.3
# via maykin-django-two-factor-auth
django-hijack==3.1.6
# via -r requirements/base.in
django-ipware==3.0.1
django-ipware==5.0.0
# via django-axes
django-log-outgoing-requests==0.4.0
# via -r requirements/base.in
Expand Down Expand Up @@ -210,7 +211,7 @@ django-tinymce==3.4.0
# via -r requirements/base.in
django-treebeard==4.5.1
# via -r requirements/base.in
django-yubin==1.7.1
django-yubin==2.0.0
# via -r requirements/base.in
djangorestframework==3.13.1
# via
Expand Down Expand Up @@ -277,8 +278,6 @@ jsonschema==4.17.3
# drf-spectacular
kombu==5.2.3
# via celery
lockfile==0.12.2
# via django-yubin
lxml==4.9.1
# via
# -r requirements/base.in
Expand Down
12 changes: 4 additions & 8 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ celery==5.2.7
# -c requirements/base.txt
# -r requirements/base.txt
# celery-once
# django-yubin
# flower
celery-once==3.0.1
# via
Expand Down Expand Up @@ -217,7 +218,7 @@ django-autoslug==1.9.9
# via
# -c requirements/base.txt
# -r requirements/base.txt
django-axes==5.31.0
django-axes[ipware]==6.0.5
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down Expand Up @@ -275,7 +276,7 @@ django-hijack==3.1.6
# via
# -c requirements/base.txt
# -r requirements/base.txt
django-ipware==3.0.1
django-ipware==5.0.0
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down Expand Up @@ -358,7 +359,7 @@ django-treebeard==4.5.1
# -r requirements/base.txt
django-webtest==1.9.7
# via -r requirements/test-tools.in
django-yubin==1.7.1
django-yubin==2.0.0
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down Expand Up @@ -506,11 +507,6 @@ kombu==5.2.3
# -c requirements/base.txt
# -r requirements/base.txt
# celery
lockfile==0.12.2
# via
# -c requirements/base.txt
# -r requirements/base.txt
# django-yubin
lxml==4.9.1
# via
# -c requirements/base.txt
Expand Down
12 changes: 4 additions & 8 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ celery==5.2.7
# -c requirements/ci.txt
# -r requirements/ci.txt
# celery-once
# django-yubin
# flower
celery-once==3.0.1
# via
Expand Down Expand Up @@ -246,7 +247,7 @@ django-autoslug==1.9.9
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
django-axes==5.31.0
django-axes[ipware]==6.0.5
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -308,7 +309,7 @@ django-hijack==3.1.6
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
django-ipware==3.0.1
django-ipware==5.0.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -399,7 +400,7 @@ django-webtest==1.9.7
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
django-yubin==1.7.1
django-yubin==2.0.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -581,11 +582,6 @@ kombu==5.2.3
# -c requirements/ci.txt
# -r requirements/ci.txt
# celery
lockfile==0.12.2
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# django-yubin
lxml==4.9.1
# via
# -c requirements/ci.txt
Expand Down
11 changes: 4 additions & 7 deletions requirements/extensions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ celery==5.2.7
# -c requirements/base.in
# -r requirements/base.txt
# celery-once
# django-yubin
# flower
celery-once==3.0.1
# via
Expand Down Expand Up @@ -181,7 +182,7 @@ django-autoslug==1.9.9
# via
# -c requirements/base.in
# -r requirements/base.txt
django-axes==5.31.0
django-axes[ipware]==6.0.5
# via
# -c requirements/base.in
# -r requirements/base.txt
Expand Down Expand Up @@ -238,7 +239,7 @@ django-hijack==3.1.6
# via
# -c requirements/base.in
# -r requirements/base.txt
django-ipware==3.0.1
django-ipware==5.0.0
# via
# -r requirements/base.txt
# django-axes
Expand Down Expand Up @@ -310,7 +311,7 @@ django-treebeard==4.5.1
# via
# -c requirements/base.in
# -r requirements/base.txt
django-yubin==1.7.1
django-yubin==2.0.0
# via
# -c requirements/base.in
# -r requirements/base.txt
Expand Down Expand Up @@ -421,10 +422,6 @@ kombu==5.2.3
# via
# -r requirements/base.txt
# celery
lockfile==0.12.2
# via
# -r requirements/base.txt
# django-yubin
lxml==4.9.1
# via
# -c requirements/base.in
Expand Down
17 changes: 4 additions & 13 deletions src/openforms/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
#
# Sending EMAIL
#
EMAIL_BACKEND = "django_yubin.smtp_queue.EmailBackend"
EMAIL_BACKEND = "django_yubin.backends.QueuedEmailBackend"
EMAIL_HOST = config("EMAIL_HOST", default="localhost")
EMAIL_PORT = config(
"EMAIL_PORT", default=25
Expand Down Expand Up @@ -612,7 +612,7 @@
)

#
# DJANGO-AXES (4.0+)
# DJANGO-AXES (6.0+)
#
AXES_CACHE = "axes" # refers to CACHES setting
# The number of login attempts allowed before a record is created for the
Expand All @@ -623,16 +623,11 @@
# an integer, will be interpreted as a number of hours. Default: None
AXES_COOLOFF_TIME = 1
# The number of reverse proxies
AXES_PROXY_COUNT = NUM_PROXIES - 1 if NUM_PROXIES else None
# If True only locks based on user id and never locks by IP if attempts limit
# exceed, otherwise utilize the existing IP and user locking logic Default:
# False
AXES_ONLY_USER_FAILURES = True
AXES_IPWARE_PROXY_COUNT = NUM_PROXIES - 1 if NUM_PROXIES else None
# If set, specifies a template to render when a user is locked out. Template
# receives cooloff_time and failure_limit as context variables. Default: None
AXES_LOCKOUT_TEMPLATE = "account_blocked.html"
AXES_USE_USER_AGENT = True # Default: False
AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP = True # Default: False
AXES_LOCKOUT_PARAMETERS = [["ip_address", "user_agent", "username"]]
AXES_BEHIND_REVERSE_PROXY = IS_HTTPS

# The default meta precedence order
Expand Down Expand Up @@ -674,10 +669,6 @@
# https://docs.celeryproject.org/en/v4.4.7/userguide/periodic-tasks.html#crontab-schedules
"schedule": crontab(minute=0, hour=0),
},
"send-emails": {
"task": "openforms.utils.tasks.send_emails",
"schedule": config("BEAT_SEND_EMAIL_INTERVAL", default=20), # every 20 seconds
},
"retry-submissions-processing": {
"task": "openforms.submissions.tasks.retry_processing_submissions",
"schedule": config("RETRY_SUBMISSIONS_INTERVAL", default=60 * 5),
Expand Down
29 changes: 5 additions & 24 deletions src/openforms/emails/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
from django.views.generic import FormView

from django_yubin.admin import (
Log as YubinLogAdmin,
Message as YubinMessageAdmin,
QueuedMessage as YubinQueuedMessageAdmin,
)
from django_yubin.models import (
Log as YubinLog,
Message as YubinMessage,
QueuedMessage as YubinQueuedMessage,
LogAdmin as YubinLogAdmin,
MessageAdmin as YubinMessageAdmin,
)
from django_yubin.models import Log as YubinLog, Message as YubinMessage
from modeltranslation.admin import TranslationAdmin

from ..utils.admin import ReadOnlyAdminMixin
Expand Down Expand Up @@ -51,7 +46,7 @@ def form_valid(self, form):
class LogReadOnlyAdmin(ReadOnlyAdminMixin, YubinLogAdmin):
readonly_fields = [
"message",
"result",
"action",
"date",
"log_message",
]
Expand All @@ -66,25 +61,11 @@ class MessageReadOnlyAdmin(ReadOnlyAdminMixin, YubinMessageAdmin):
"to_address",
"from_address",
"subject",
"encoded_message",
"message_data",
"date_created",
"date_sent",
]


admin.site.unregister(YubinMessage)
admin.site.register(YubinMessage, MessageReadOnlyAdmin)


class QueuedMessageReadOnlyAdmin(ReadOnlyAdminMixin, YubinQueuedMessageAdmin):
readonly_fields = [
"message",
"priority",
"deferred",
"retries",
"date_queued",
]


admin.site.unregister(YubinQueuedMessage)
admin.site.register(YubinQueuedMessage, QueuedMessageReadOnlyAdmin)
2 changes: 1 addition & 1 deletion src/openforms/emails/tests/test_check_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_ok(self):
@override_settings(
**replace(
smtp_settings,
EMAIL_BACKEND="django_yubin.smtp_queue.EmailBackend",
EMAIL_BACKEND="django_yubin.backends.QueuedEmailBackend",
)
)
def test_init_yubin(self):
Expand Down
8 changes: 4 additions & 4 deletions src/openforms/fixtures/default_admin_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@
"axes",
"accesslog"
],
[
"axes",
"accessfailurelog"
],
[
"cookie_consent",
"logitem"
Expand All @@ -260,10 +264,6 @@
"django_yubin",
"message"
],
[
"django_yubin",
"queuedmessage"
],
[
"logging",
"avgtimelinelogproxy"
Expand Down
40 changes: 20 additions & 20 deletions src/openforms/fixtures/default_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,26 @@
"axes",
"accessattempt"
],
[
"add_accessfailurelog",
"axes",
"accessfailurelog"
],
[
"change_accessfailurelog",
"axes",
"accessfailurelog"
],
[
"delete_accessfailurelog",
"axes",
"accessfailurelog"
],
[
"view_accessfailurelog",
"axes",
"accessfailurelog"
],
[
"add_accesslog",
"axes",
Expand Down Expand Up @@ -928,26 +948,6 @@
"django_yubin",
"message"
],
[
"add_queuedmessage",
"django_yubin",
"queuedmessage"
],
[
"change_queuedmessage",
"django_yubin",
"queuedmessage"
],
[
"delete_queuedmessage",
"django_yubin",
"queuedmessage"
],
[
"view_queuedmessage",
"django_yubin",
"queuedmessage"
],
[
"add_confirmationemailtemplate",
"emails",
Expand Down
2 changes: 1 addition & 1 deletion src/openforms/registrations/contrib/email/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def check_config():
if settings.EMAIL_BACKEND == "django_yubin.smtp_queue.EmailBackend":
if settings.EMAIL_BACKEND == "django_yubin.backends.QueuedEmailBackend":
backend = yubin_settings.USE_BACKEND
else:
backend = settings.EMAIL_BACKEND
Expand Down
Loading

0 comments on commit 625a474

Please sign in to comment.