Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Jul 25, 2023
1 parent 2a1b49c commit fe174f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
31 changes: 0 additions & 31 deletions src/redturtle/prenotazioni/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,37 +216,6 @@ def to_1500(context):
)


def to_1502_upgrade_texts(context):
new_fields = {
"notify_on_submit_subject": "Prenotazione creata correttamente per ${title}",
"notify_on_submit_message": "notify_on_submit_message",
"notify_on_confirm_subject": "Prenotazione del ${booking_date} alle ${booking_time} accettata",
"notify_on_confirm_message": (
"La prenotazione ${booking_type} per ${title} è stata confermata!"
"Se non hai salvato o stampato il promemoria, puoi visualizzarlo su <a href=${booking_print_url}>questo link</a>"
"Se desideri cancellare la prenotazione, accedi a <a href=${booking_print_url}>questo link</a>"
),
"notify_on_move_subject": ("Modifica data di prenotazione per ${title}"),
"notify_on_move_message": (
"L'orario della sua prenotazione ${booking_type} è stata modificato."
"La nuova data è ${booking_date} alle ore ${booking_time}."
"Controlla o stampa il nuovo promemoria su <a href=${booking_print_url}>questo link</a>."
),
"notify_on_refuse_subject": "Prenotazione rifiutata per ${title}",
"notify_on_refuse_message": "La prenotazione ${booking_type} del ${booking_date} delle ore ${booking_time} è stata rifiutata.",
}

for brain in api.portal.get_tool("portal_catalog")(
portal_type="PrenotazioniFolder"
):
object = brain.getObject()

logger.info(f"[1501-1502] Updating fields on {brain.getPath()}")

for name, value in new_fields.items():
setattr(object, name, value)


def to_1502_upgrade_contentrules(context):
from plone.contentrules.engine.interfaces import IRuleStorage
from plone.contentrules.engine.interfaces import IRuleAssignmentManager
Expand Down
4 changes: 0 additions & 4 deletions src/redturtle/prenotazioni/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@
source="1501"
destination="1502"
>
<genericsetup:upgradeStep
title="Popolate the PrenotazioniFolder new fields"
handler=".upgrades.to_1502_upgrade_texts"
/>
<genericsetup:upgradeStep
title="Remove all the deprecated contentrules"
handler=".upgrades.to_1502_upgrade_contentrules"
Expand Down

0 comments on commit fe174f0

Please sign in to comment.