Skip to content

Commit

Permalink
Integrate PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschuppi81 committed Jan 27, 2025
1 parent 0375576 commit b34c04d
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 29 deletions.
11 changes: 6 additions & 5 deletions src/onegov/org/forms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,8 @@ class NewsletterSettingsForm(Form):

notify_on_unsubscription = ChosenSelectMultipleEmailField(
label=_('Notify on newsletter unsubscription'),
description=_('Send an email notification when a user unsubscribes '
'from the newsletter'),
description=_('Send an email notification to the following users '
'when a recipient unsubscribes from the newsletter'),
validators=[StrictOptional()],
choices=[]
)
Expand Down Expand Up @@ -1249,10 +1249,11 @@ def process_obj(self, model: Organisation) -> None: # type:ignore
self.notify_on_unsubscription.data = model.notify_on_unsubscription

Check warning on line 1249 in src/onegov/org/forms/settings.py

View check run for this annotation

Codecov / codecov/patch

src/onegov/org/forms/settings.py#L1248-L1249

Added lines #L1248 - L1249 were not covered by tests

def on_request(self) -> None:
user_q = self.request.session.query(User).filter_by(role='admin')
user_q = user_q.order_by(User.username.desc())
users = self.request.session.query(User).filter(
User.role.in_(['admin', 'editor']))
users = users.order_by(User.username.desc())
self.notify_on_unsubscription.choices = [
(u.username, u.title) for u in user_q if '@' in u.username
(u.username) for u in users if '@' in u.username
]


Expand Down
10 changes: 6 additions & 4 deletions src/onegov/org/locale/de_CH/LC_MESSAGES/onegov.org.po
Original file line number Diff line number Diff line change
Expand Up @@ -3858,11 +3858,13 @@ msgstr "Wir wünschen Ihnen einen schönen Tag!"
msgid "Notify on newsletter unsubscription"
msgstr "Benachrichtigung bei Abmeldung vom Newsletter"

msgid "Send an email notification when a user unsubscribes from the newsletter"
msgstr "Sende eine E-Mail-Benachrichtigung, wenn sich ein Benutzer vom Newsletter abmeldet"
msgid "Send an email notification to the following users when a recipient "
"unsubscribes from the newsletter"
msgstr "Sende eine E-Mail-Benachrichtigung an die folgenden Benutzer, wenn "
"sich ein Empfänger vom Newsletter abmeldet"

msgid "Hi Admin,"
msgstr "Hallo Administrator"
msgid "Unsubscription from newsletter"
msgstr "Abmeldung vom Newsletter"

msgid "The user with the address ${address} just unsubscribed from the newsletter subscriber list."
msgstr "Der Benutzer mit der Adresse ${address} hat sich soeben von der Newsletter-Abonnentenliste abgemeldet."
Expand Down
10 changes: 6 additions & 4 deletions src/onegov/org/locale/fr_CH/LC_MESSAGES/onegov.org.po
Original file line number Diff line number Diff line change
Expand Up @@ -3859,11 +3859,13 @@ msgstr "Passez une bonne journée!"
msgid "Notify on newsletter unsubscription"
msgstr "Notifier le désabonnement à la lettre d'information"

msgid "Send an email notification when a user unsubscribes from the newsletter"
msgstr "Envoyer une notification par courrier électronique lorsqu'un utilisateur se désinscrit de la lettre d'information"
msgid "Send an email notification to the following users when a recipient "
"unsubscribes from the newsletter"
msgstr "Envoyer une notification par e-mail aux utilisateurs suivants lorsqu'un "
"destinataire se désabonne de la newsletter"

msgid "Hi Admin,"
msgstr "Bonjour administrateur"
msgid "Unsubscription from newsletter"
msgstr "Se désabonner de la lettre d'information"

msgid "The user with the address ${address} just unsubscribed from the newsletter subscriber list."
msgstr "L'utilisateur dont l'adresse est ${address} vient de se désinscrire de la liste des abonnés à la lettre d'information."
Expand Down
10 changes: 6 additions & 4 deletions src/onegov/org/locale/it_CH/LC_MESSAGES/onegov.org.po
Original file line number Diff line number Diff line change
Expand Up @@ -3851,11 +3851,13 @@ msgstr "Ti auguro una buona giornata!"
msgid "Notify on newsletter unsubscription"
msgstr "Notifica di annullamento dell'iscrizione alla newsletter"

msgid "Send an email notification when a user unsubscribes from the newsletter"
msgstr "Inviare una notifica via e-mail quando un utente si cancella dalla newsletter"
msgid "Send an email notification to the following users when a recipient "
"unsubscribes from the newsletter"
msgstr "Inviare una notifica via e-mail ai seguenti utenti quando un "
"destinatario si cancella dalla newsletter"

msgid "Hi Admin,"
msgstr "Salve amministratore"
msgid "Unsubscription from newsletter"
msgstr "Cancellazione dalla newsletter"

msgid "The user with the address ${address} just unsubscribed from the newsletter subscriber list."
msgstr "L'utente con l'indirizzo ${indirizzo} si è appena cancellato dalla lista degli iscritti alla newsletter."
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/org/templates/mail_notify_unsubscribe.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
${title}
</tal:b>
<tal:b metal:fill-slot="body">
<p i18n:translate>Hi Admin,</p>
<p i18n:translate>Hello</p>

<p i18n:translate>
The user with the address <strong i18n:name="address">${address}</strong> just unsubscribed from the newsletter subscriber list.
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/org/views/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def view_unsubscribe(
receivers = request.app.org.notify_on_unsubscription or None
if receivers:
subject = _(
'Unsubscription from the newsletter at ${address}',
'Unsubscription from newsletter',
mapping={'address': address}
)
send_transactional_html_mail(
Expand Down
3 changes: 0 additions & 3 deletions src/onegov/town6/locale/de_CH/LC_MESSAGES/onegov.town6.po
Original file line number Diff line number Diff line change
Expand Up @@ -1074,9 +1074,6 @@ msgstr "Benachrichtigung bei Abmeldung vom Newsletter"
msgid "Send an email notification when a user unsubscribes from the newsletter"
msgstr "Sende eine E-Mail-Benachrichtigung, wenn sich ein Benutzer vom Newsletter abmeldet"

msgid "Hi Admin,"
msgstr "Hallo Administrator"

msgid "The user with the address <strong>${address}</strong> just unsubscribed from the newsletter subscriber list."
msgstr "Der Benutzer mit der Adresse <strong>${address}</strong> hat sich soeben von der Newsletter-Abonnentenliste abgemeldet."

Expand Down
3 changes: 0 additions & 3 deletions src/onegov/town6/locale/fr_CH/LC_MESSAGES/onegov.town6.po
Original file line number Diff line number Diff line change
Expand Up @@ -1075,9 +1075,6 @@ msgstr "Notifier le désabonnement à la lettre d'information"
msgid "Send an email notification when a user unsubscribes from the newsletter"
msgstr "Envoyer une notification par courrier électronique lorsqu'un utilisateur se désinscrit de la lettre d'information"

msgid "Hi Admin,"
msgstr "Bonjour administrateur"

msgid "The user with the address ${address} just unsubscribed from the newsletter subscriber list."
msgstr "L'utilisateur dont l'adresse est ${address} vient de se désinscrire de la liste des abonnés à la lettre d'information."

Expand Down
3 changes: 0 additions & 3 deletions src/onegov/town6/locale/it_CH/LC_MESSAGES/onegov.town6.po
Original file line number Diff line number Diff line change
Expand Up @@ -1076,9 +1076,6 @@ msgstr "Notifica di annullamento dell'iscrizione alla newsletter"
msgid "Send an email notification when a user unsubscribes from the newsletter"
msgstr "Inviare una notifica via e-mail quando un utente si cancella dalla newsletter"

msgid "Hi Admin,"
msgstr "Salve amministratore"

msgid "The user with the address ${address} just unsubscribed from the newsletter subscriber list."
msgstr "L'utente con l'indirizzo ${indirizzo} si è appena cancellato dalla lista degli iscritti alla newsletter."

Expand Down
2 changes: 1 addition & 1 deletion src/onegov/town6/templates/mail_notify_unsubscribe.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
${title}
</tal:b>
<tal:b metal:fill-slot="body">
<p i18n:translate>Hi Admin,</p>
<p i18n:translate>Hello</p>

<p i18n:translate>
The user with the address <strong i18n:name="address">${address}</strong> just unsubscribed from the newsletter subscriber list.
Expand Down

0 comments on commit b34c04d

Please sign in to comment.