def save_changes(self):
new_projects = []
removed_projects = []
for project_id, project in six.iteritems(self.projects_by_id):
if project_id in self.cleaned_data['projects']:
if enable_plugin_for_tenant(project, self.tenant):
new_projects.append(project)
else:
if disable_plugin_for_tenant(project, self.tenant):
removed_projects.append(project)
if new_projects or removed_projects:
with Context.for_tenant(self.tenant) as ctx:
ctx.send_notification(
**make_subscription_update_notification(new_projects, removed_projects)
)
if removed_projects:
mentions.clear_project_mentions(self.tenant, removed_projects)
ctx.push_recent_events_glance()
评论列表
文章目录