app/commands/decidim/conferences/admin/update_conference.rb in decidim-conferences-0.18.1 vs app/commands/decidim/conferences/admin/update_conference.rb in decidim-conferences-0.19.0
- old
+ new
@@ -21,10 +21,11 @@
# - :invalid if the form wasn't valid and we couldn't proceed.
#
# Returns nothing.
def call
return broadcast(:invalid) if form.invalid?
+
update_conference
link_participatory_processes
link_assemblies
link_consultations
@@ -97,11 +98,13 @@
followers: @conference.followers
)
end
def should_notify_followers_registrations_enabled?
- @conference.previous_changes["registrations_enabled"].present? && @conference.registrations_enabled?
+ @conference.previous_changes["registrations_enabled"].present? &&
+ @conference.registrations_enabled? &&
+ @conference.published?
end
def send_notification_update_conference
Decidim::EventsManager.publish(
event: "decidim.events.conferences.conference_updated",
@@ -110,10 +113,11 @@
followers: @conference.followers
)
end
def should_notify_followers_update_conference?
- important_attributes.any? { |attr| @conference.previous_changes[attr].present? }
+ important_attributes.any? { |attr| @conference.previous_changes[attr].present? } &&
+ @conference.published?
end
def important_attributes
%w(start_date end_date location)
end