diff --git a/ema/filters.py b/ema/filters.py index 308f14ef..2817d6dc 100644 --- a/ema/filters.py +++ b/ema/filters.py @@ -7,47 +7,12 @@ Created on: 19.08.21 """ from django.db.models import QuerySet -from compensation.filters import CompensationTableFilter +from compensation.filters import EcoAccountTableFilter -class EmaTableFilter(CompensationTableFilter): +class EmaTableFilter(EcoAccountTableFilter): """ Since EMA and compensation are basically the same, we can reuse CompensationTableFilter and extend the MAE filter in the future by inheriting. """ - - def _filter_show_all(self, queryset, name, value) -> QuerySet: - """ Filters queryset depending on value of 'show_all' setting - - Args: - queryset (): - name (): - value (): - - Returns: - - """ - if not value: - return queryset.filter( - users__in=[self.user], # requesting user has access - ) - else: - return queryset - - def _filter_show_recorded(self, queryset, name, value) -> QuerySet: - """ Filters queryset depending on value of 'show_recorded' setting - - Args: - queryset (): - name (): - value (): - - Returns: - - """ - if not value: - return queryset.filter( - recorded=None, - ) - else: - return queryset \ No newline at end of file + pass \ No newline at end of file diff --git a/ema/views.py b/ema/views.py index 2f6a6650..31103308 100644 --- a/ema/views.py +++ b/ema/views.py @@ -167,10 +167,11 @@ def record_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) + msg_succ = _("{} unrecorded") if ema.recorded else _("{} recorded") form = RecordForm(request.POST or None, instance=ema, user=request.user) return form.process_request( request=request, - msg_success=_("EMA recorded"), + msg_success=msg_succ.format("EMA"), ) diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 7b0786e8..c48b2310 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 7ffe228a..9fedbb21 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-19 14:01+0200\n" +"POT-Creation-Date: 2021-08-19 14:33+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -656,23 +656,23 @@ msgid "Compensation removed" msgstr "Kompensation entfernt" #: compensation/views/compensation_views.py:162 -#: compensation/views/eco_account_views.py:283 ema/views.py:248 +#: compensation/views/eco_account_views.py:283 ema/views.py:249 #: intervention/views.py:93 msgid "Document added" msgstr "Dokument hinzugefügt" #: compensation/views/compensation_views.py:181 -#: compensation/views/eco_account_views.py:227 ema/views.py:192 +#: compensation/views/eco_account_views.py:227 ema/views.py:193 msgid "State added" msgstr "Zustand hinzugefügt" #: compensation/views/compensation_views.py:200 -#: compensation/views/eco_account_views.py:246 ema/views.py:211 +#: compensation/views/eco_account_views.py:246 ema/views.py:212 msgid "Action added" msgstr "Maßnahme hinzugefügt" #: compensation/views/compensation_views.py:219 -#: compensation/views/eco_account_views.py:265 ema/views.py:230 +#: compensation/views/eco_account_views.py:265 ema/views.py:231 msgid "Deadline added" msgstr "Frist/Termin hinzugefügt" @@ -692,11 +692,13 @@ msgstr "Ökokonto entfernt" msgid "Withdraw removed" msgstr "Abbuchung entfernt" -#: compensation/views/eco_account_views.py:204 intervention/views.py:376 +#: compensation/views/eco_account_views.py:204 ema/views.py:170 +#: intervention/views.py:376 msgid "{} unrecorded" msgstr "{} entzeichnet" -#: compensation/views/eco_account_views.py:204 intervention/views.py:376 +#: compensation/views/eco_account_views.py:204 ema/views.py:170 +#: intervention/views.py:376 msgid "{} recorded" msgstr "{} verzeichnet" @@ -733,16 +735,8 @@ msgid "Payment funded compensation" msgstr "Ersatzzahlungsmaßnahme" #: ema/views.py:153 -#, fuzzy -#| msgid "{} removed" msgid "EMA removed" -msgstr "{} entfernt" - -#: ema/views.py:173 -#, fuzzy -#| msgid "{} recorded" -msgid "EMA recorded" -msgstr "{} verzeichnet" +msgstr "EMA entfernt" #: intervention/filters.py:25 msgid "Show unshared" @@ -909,6 +903,7 @@ msgid "" "Eco-account {} is not recorded yet. You can only withdraw from recorded " "accounts." msgstr "" +"Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von verzeichneten Ökokonten erfolgen." #: intervention/forms.py:544 msgid "" @@ -1248,11 +1243,11 @@ msgstr "{} geprüft" #: konova/utils/messenger.py:71 msgid "Check it out" -msgstr "" +msgstr "Schauen Sie rein" #: konova/utils/messenger.py:72 msgid "{} has been checked successfully by user {}! {}" -msgstr "" +msgstr "{} wurde erfolgreich vom Nutzer {} geprüft! {}" #: konova/views.py:138 msgid "Document '{}' deleted" @@ -2670,6 +2665,9 @@ msgstr "" msgid "A fontawesome icon field" msgstr "" +#~ msgid "EMA recorded" +#~ msgstr "EMA verzeichnet" + #~ msgid "Edit {}" #~ msgstr "Bearbeite {}"