org.upgrade

Contains upgrade tasks that are executed when the application is being upgraded on the server. See onegov.core.upgrade.upgrade_task.

Functions

move_town_to_organisation(→ bool | None)

add_image_dimensions_to_html(→ None)

remove_official_notices_table(→ bool | None)

add_new_defaults_to_existing_directories(→ None)

migrate_enable_map_option(→ None)

fix_directory_order(→ None)

add_default_recirect_setting(→ None)

rename_guideline_to_submissions_guideline(→ None)

add_content_show_property_to_people(→ None)

add_meta_access_property(→ None)

add_rerender_organsiation_html(→ None)

fix_directory_file_identity(→ None)

cache_news_hashtags_in_meta(→ None)

change_daily_ticket_statistics_data_format(→ None)

fix_content_people_for_models_that_use_person_link_extension(→ None)

fix_nested_list_in_content_people(→ None)

add_files_linked_in_content(→ None)

add_submission_window_id_to_survey_submissions(→ None)

remove_stored_contact_html_and_opening_hours_html(→ None)

add_cascade_delete_to_push_notification(→ None)

convert_sent_at_to_utc_datetime(→ None)

create_hierarchy_and_move_organisations_to_content(→ None)

convert_directories_to_ticket_permissions(→ None)

set_default_extras_pricing_method(→ None)

add_party_column_to_par_parliamentarians(→ None)

migrate_kaba_config_to_new_format(→ None)

update_political_business_enum_values(→ None)

change_political_business_participation_type_column_type(→ None)

remove_obsolete_polymorphic_type_columns(→ None)

make_political_business_participation_type_column_nullable(→ None)

update_political_business_type_enum_values(→ None)

cache_new_news_hashtags_in_meta(→ None)

add_show_only_previews_column_to_newsletters(→ None)

migrate_analytics_code(→ None)

fix_missing_reserved_slots(→ tuple[list[Any], ...)

Fixes approved reservations that have no reserved slots.

recreate_missing_reserved_slots(→ None)

Fixes approved reservations whose ReservedSlot rows were erroneously

subscribe_customer_message_recipients_to_cancellation_requests(→ None)

switch_to_parsed_event_filters(→ None)

refresh_zeroed_reservation_invoices(→ None)

Store pricing settings on reservations (fixed) repairs the

Module Contents

org.upgrade.move_town_to_organisation(context: onegov.core.upgrade.UpgradeContext) bool | None[source]
org.upgrade.add_image_dimensions_to_html(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.remove_official_notices_table(context: onegov.core.upgrade.UpgradeContext) bool | None[source]
org.upgrade.add_new_defaults_to_existing_directories(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.migrate_enable_map_option(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.fix_directory_order(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_default_recirect_setting(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.rename_guideline_to_submissions_guideline(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_content_show_property_to_people(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_meta_access_property(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_rerender_organsiation_html(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.fix_directory_file_identity(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.cache_news_hashtags_in_meta(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.change_daily_ticket_statistics_data_format(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.fix_nested_list_in_content_people(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_files_linked_in_content(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_submission_window_id_to_survey_submissions(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.remove_stored_contact_html_and_opening_hours_html(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_cascade_delete_to_push_notification(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.convert_sent_at_to_utc_datetime(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.create_hierarchy_and_move_organisations_to_content(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.convert_directories_to_ticket_permissions(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.set_default_extras_pricing_method(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_party_column_to_par_parliamentarians(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.migrate_kaba_config_to_new_format(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.update_political_business_enum_values(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.change_political_business_participation_type_column_type(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.remove_obsolete_polymorphic_type_columns(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.make_political_business_participation_type_column_nullable(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.update_political_business_type_enum_values(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.cache_new_news_hashtags_in_meta(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.add_show_only_previews_column_to_newsletters(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.migrate_analytics_code(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.fix_missing_reserved_slots(session: Any) tuple[list[Any], list[tuple[Any, bool]]][source]

Fixes approved reservations that have no reserved slots.

Returns (recreated_starts, deleted_starts). recreated_starts is a list of start datetimes of reservations whose slots were recreated. deleted_starts entries are (start, noted) tuples where noted indicates whether a ticket note was added.

org.upgrade.recreate_missing_reserved_slots(context: onegov.core.upgrade.UpgradeContext) None[source]

Fixes approved reservations whose ReservedSlot rows were erroneously deleted by a libres bug that occurred when rejecting one reservation on a partly-available allocation also removed the sibling reservation’s slots.

For each affected reservation the slots are recreated if the time range is still free. If another reservation already owns those slots the orphaned reservation is deleted and a note is added to its ticket.

org.upgrade.subscribe_customer_message_recipients_to_cancellation_requests(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.switch_to_parsed_event_filters(context: onegov.core.upgrade.UpgradeContext) None[source]
org.upgrade.refresh_zeroed_reservation_invoices(context: onegov.core.upgrade.UpgradeContext) None[source]

Store pricing settings on reservations (fixed) repairs the reservation data, but invoice lines already zeroed by an earlier refresh still show 0. Recompute them now that the reservation prices are restored.

Scoped to reservation invoices touched since the backfill rollout that are tied to an allocation the bug could have disturbed (per_item/per_hour/ free — the original broken OR only ever matched free), or to a per_item resource (whose content fallback was the broken one). Only refreshed when safe (manual, still-open payment).