Skip to content

Commit

Permalink
Fixed checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
stranck committed Jan 10, 2025
1 parent 2e0d5ac commit dac4a75
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 25 deletions.
2 changes: 1 addition & 1 deletion fzbackendutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "0.9.20250110"
42 changes: 41 additions & 1 deletion fzbackendutils/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,51 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-07 19:01+0100\n"
"POT-Creation-Date: 2025-01-10 14:00+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: APSfurizon\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: fzbackendutils/apps.py:17
msgid "Pretix fz-backend utils"
msgstr ""

#: fzbackendutils/apps.py:19
msgid "Pretix utils plugin to work together with fz-backend"
msgstr ""

#: fzbackendutils/signals.py:59
msgid "Fz-backend settings"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:5
msgid "Fz-backend-utils settings"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:7
msgid ""
"Here you can change various pretix settings about the interaction with the "
"fz-backend"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:19
msgid "Save"
msgstr ""

#: fzbackendutils/views.py:16
msgid "Order redirect url"
msgstr ""

#: fzbackendutils/views.py:17
#, python-brace-format
msgid ""
"When an user has done, has modified or has paid an order, pretix will "
"redirect him to this spacified url, with the order code and secret appended "
"as query parameters (<code>?c={orderCode}&s={orderSecret}&m={statusMessages}"
"</code>). This page should call <code>/api/v1/orders-workflow/link-order</"
"code> of the backend to link this order to the logged in user."
msgstr ""
42 changes: 41 additions & 1 deletion fzbackendutils/locale/de_Informal/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,51 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-07 19:01+0100\n"
"POT-Creation-Date: 2025-01-10 14:00+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: APSfurizon\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: fzbackendutils/apps.py:17
msgid "Pretix fz-backend utils"
msgstr ""

#: fzbackendutils/apps.py:19
msgid "Pretix utils plugin to work together with fz-backend"
msgstr ""

#: fzbackendutils/signals.py:59
msgid "Fz-backend settings"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:5
msgid "Fz-backend-utils settings"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:7
msgid ""
"Here you can change various pretix settings about the interaction with the "
"fz-backend"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:19
msgid "Save"
msgstr ""

#: fzbackendutils/views.py:16
msgid "Order redirect url"
msgstr ""

#: fzbackendutils/views.py:17
#, python-brace-format
msgid ""
"When an user has done, has modified or has paid an order, pretix will "
"redirect him to this spacified url, with the order code and secret appended "
"as query parameters (<code>?c={orderCode}&s={orderSecret}&m={statusMessages}"
"</code>). This page should call <code>/api/v1/orders-workflow/link-order</"
"code> of the backend to link this order to the logged in user."
msgstr ""
58 changes: 58 additions & 0 deletions fzbackendutils/locale/django.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-10 14:00+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: fzbackendutils/apps.py:17
msgid "Pretix fz-backend utils"
msgstr ""

#: fzbackendutils/apps.py:19
msgid "Pretix utils plugin to work together with fz-backend"
msgstr ""

#: fzbackendutils/signals.py:59
msgid "Fz-backend settings"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:5
msgid "Fz-backend-utils settings"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:7
msgid ""
"Here you can change various pretix settings about the interaction with the "
"fz-backend"
msgstr ""

#: fzbackendutils/templates/fzbackendutils/settings.html:19
msgid "Save"
msgstr ""

#: fzbackendutils/views.py:16
msgid "Order redirect url"
msgstr ""

#: fzbackendutils/views.py:17
#, python-brace-format
msgid ""
"When an user has done, has modified or has paid an order, pretix will "
"redirect him to this spacified url, with the order code and secret appended "
"as query parameters (<code>?c={orderCode}&s={orderSecret}&m={statusMessages}"
"</code>). This page should call <code>/api/v1/orders-workflow/link-order</"
"code> of the backend to link this order to the logged in user."
msgstr ""
24 changes: 10 additions & 14 deletions fzbackendutils/signals.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
import logging

from urllib.parse import urlencode

from django.core.exceptions import PermissionDenied
from django.contrib.messages import constants as messages, get_messages
from django.core.exceptions import PermissionDenied
from django.dispatch import receiver
from django.urls import resolve, reverse

from django.utils.translation import gettext_lazy as _
from pretix.control.signals import nav_event_settings
from pretix.helpers.http import redirect_to_url
from pretix.presale.signals import process_request
from pretix.control.signals import nav_event_settings

from django.utils.translation import gettext_lazy as _
from urllib.parse import urlencode

logger = logging.getLogger(__name__)


@receiver(process_request, dispatch_uid="fzbackendutils_process_request")
def returnurl_process_request(sender, request, **kwargs):
try:
r = resolve(request.path_info)
except:
logger.error("Error while resolving path info")
except Exception as e:
logger.error("Error while resolving path info:", e)
return

if r.url_name == "event.order":
urlkwargs = r.kwargs

if not sender.settings.fzbackendutils_redirect_url:
raise PermissionDenied('fz-backend-utils: no order redirect url set')
# Fetch order status messages

# Fetch order status messages
query = []
storage = get_messages(request)
for message in storage:
Expand All @@ -49,7 +46,6 @@ def returnurl_process_request(sender, request, **kwargs):
return redirect_to_url(url)



@receiver(nav_event_settings, dispatch_uid='fzbackendutils_nav')
def navbar_info(sender, request, **kwargs):
url = resolve(request.path_info)
Expand All @@ -62,4 +58,4 @@ def navbar_info(sender, request, **kwargs):
'organizer': request.organizer.slug,
}),
'active': url.namespace == 'plugins:fzbackendutils',
}]
}]
2 changes: 1 addition & 1 deletion fzbackendutils/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
urlpatterns = [
re_path(r'^control/event/(?P<organizer>[^/]+)/(?P<event>[^/]+)/fzbackendutils/settings$',
FznackendutilsSettings.as_view(), name='settings'),
]
]
8 changes: 2 additions & 6 deletions fzbackendutils/views.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import re

from django import forms
from django.urls import reverse
from django.utils.translation import gettext_lazy as _

from pretix.base.forms import SettingsForm
from pretix.base.models import Event
from pretix.control.views.event import (
EventSettingsFormView, EventSettingsViewMixin,
)
from pretix.control.views.event import EventSettingsFormView, EventSettingsViewMixin


class FznackendutilsSettingsForm(SettingsForm):
Expand All @@ -34,4 +30,4 @@ def get_success_url(self) -> str:
return reverse('plugins:fzbackendutils:settings', kwargs={
'organizer': self.request.event.organizer.slug,
'event': self.request.event.slug
})
})
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "pretix-fzbackend-utils"
name = "fzbackendutils"
dynamic = ["version"]
description = "Pretix utils plugin to work together with fz-backend"
readme = "README.rst"
Expand Down

0 comments on commit dac4a75

Please sign in to comment.