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(context) → bool | None

add_image_dimensions_to_html(context) → None

remove_official_notices_table(context) → bool | None

add_new_defaults_to_existing_directories(context) → None

migrate_enable_map_option(context) → None

fix_directory_order(context) → None

add_default_recirect_setting(context) → None

rename_guideline_to_submissions_guideline(context) → None

add_content_show_property_to_people(context) → None

add_meta_access_property(context) → None

add_rerender_organsiation_html(context) → None

fix_directory_file_identity(context) → None

cache_news_hashtags_in_meta(context) → None

change_daily_ticket_statistics_data_format(context) → None

fix_content_people_for_models_that_use_person_link_extension(context) → None

fix_nested_list_in_content_people(context) → None

add_files_linked_in_content(context) → None

add_submission_window_id_to_survey_submissions(context) → None

remove_stored_contact_html_and_opening_hours_html(context) → None

add_cascade_delete_to_push_notification(context) → None

convert_sent_at_to_utc_datetime(context) → None

create_hierarchy_and_move_organisations_to_content(context) → None

convert_directories_to_ticket_permissions(context) → None

set_default_extras_pricing_method(context) → None

add_party_column_to_par_parliamentarians(context) → None

migrate_kaba_config_to_new_format(context) → None

change_political_business_participation_type_column_type(context) → None

remove_obsolete_polymorphic_type_columns(context) → None

make_political_business_participation_type_column_nullable(context) → None

add_publication_dates_to_political_businesses(context) → None

update_political_business_type_enum_values(context) → None

cache_new_news_hashtags_in_meta(context) → None

add_show_only_previews_column_to_newsletters(context) → None

migrate_analytics_code(context) → None

fix_missing_reserved_slots(session) → tuple[list[Any], list[tuple[Any, bool]]]

Fixes approved reservations that have no reserved slots.

recreate_missing_reserved_slots(context) → None

Fixes approved reservations whose ReservedSlot rows were erroneously

subscribe_customer_message_recipients_to_cancellation_requests(context) → None

switch_to_parsed_event_filters(context) → None

refresh_zeroed_reservation_invoices(context) → 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.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.add_publication_dates_to_political_businesses(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).