Example #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)
Example #2
0
 def _process(self):
     form = ContributionProtectionForm(obj=FormDefaults(**self._get_defaults()), contrib=self.contrib,
                                       prefix='contribution-protection-')
     if form.validate_on_submit():
         update_contribution(self.contrib, {'protection_mode': form.protection_mode.data})
         update_object_principals(self.contrib, form.managers.data, full_access=True)
         if self.contrib.is_protected:
             update_object_principals(self.contrib, form.acl.data, read_access=True)
         update_object_principals(self.contrib, form.submitters.data, role='submit')
         return jsonify_data(flash=False, **self.list_generator.render_list(self.contrib))
     return jsonify_form(form)
Example #3
0
 def _process(self):
     form = ContributionProtectionForm(obj=FormDefaults(**self._get_defaults()), contrib=self.contrib,
                                       prefix='contribution-protection-')
     if form.validate_on_submit():
         update_contribution(self.contrib, {'protection_mode': form.protection_mode.data})
         update_object_principals(self.contrib, form.managers.data, full_access=True)
         if self.contrib.is_protected:
             update_object_principals(self.contrib, form.acl.data, read_access=True)
         update_object_principals(self.contrib, form.submitters.data, role='submit')
         return jsonify_data(flash=False, **self.list_generator.render_list(self.contrib))
     return jsonify_form(form)