Пример #1
0
 def _process(self):
     form = ContributionProtectionForm(obj=FormDefaults(**self._get_defaults()), contrib=self.contrib,
                                       prefix='contribution-protection-')
     if form.validate_on_submit():
         update_permissions(self.contrib, form)
         update_contribution(self.contrib, {'protection_mode': form.protection_mode.data})
         return jsonify_data(flash=False, **self.list_generator.render_list(self.contrib))
     return jsonify_template('events/management/protection_dialog.html', form=form)
Пример #2
0
 def _process(self):
     form = SessionProtectionForm(obj=FormDefaults(**self._get_defaults()), session=self.session,
                                  prefix='session-protection-')
     if form.validate_on_submit():
         update_permissions(self.session, form)
         update_session(self.session, {'protection_mode': form.protection_mode.data})
         return jsonify_data(flash=False, html=_render_session_list(self.event))
     return jsonify_template('events/management/protection_dialog.html', form=form)
Пример #3
0
 def _process(self):
     form = SessionProtectionForm(obj=FormDefaults(**self._get_defaults()), session=self.session,
                                  prefix='session-protection-')
     if form.validate_on_submit():
         update_permissions(self.session, form)
         update_session(self.session, {'protection_mode': form.protection_mode.data})
         return jsonify_data(flash=False, html=_render_session_list(self.event))
     return jsonify_template('events/management/protection_dialog.html', form=form)
Пример #4
0
 def _process(self):
     event = self.event
     form = EventProtectionForm(obj=FormDefaults(**self._get_defaults()), event=event)
     if form.validate_on_submit():
         update_permissions(event, form)
         update_event_protection(event, {'protection_mode': form.protection_mode.data,
                                         'own_no_access_contact': form.own_no_access_contact.data,
                                         'access_key': form.access_key.data,
                                         'visibility': form.visibility.data})
         self._update_session_coordinator_privs(form)
         flash(_('Protection settings have been updated'), 'success')
         return redirect(url_for('.protection', event))
     return WPEventProtection.render_template('event_protection.html', event, 'protection', form=form)
Пример #5
0
 def _process(self):
     event = self.event
     form = EventProtectionForm(obj=FormDefaults(**self._get_defaults()), event=event)
     if form.validate_on_submit():
         update_permissions(event, form)
         update_event_protection(event, {'protection_mode': form.protection_mode.data,
                                         'own_no_access_contact': form.own_no_access_contact.data,
                                         'access_key': form.access_key.data,
                                         'visibility': form.visibility.data})
         self._update_session_coordinator_privs(form)
         flash(_('Protection settings have been updated'), 'success')
         return redirect(url_for('.protection', event))
     return WPEventProtection.render_template('event_protection.html', event, 'protection', form=form)