Ejemplo n.º 1
0
 def _clone_contrib_types(self, new_event):
     attrs = get_simple_column_attrs(ContributionType)
     for old_contrib_type in self.old_event.contribution_types:
         contrib_type = ContributionType()
         contrib_type.populate_from_attrs(old_contrib_type, attrs)
         new_event.contribution_types.append(contrib_type)
         self._contrib_type_map[old_contrib_type] = contrib_type
Ejemplo n.º 2
0
 def _clone_contrib_types(self, new_event):
     attrs = get_simple_column_attrs(ContributionType)
     for old_contrib_type in self.old_event.contribution_types:
         contrib_type = ContributionType()
         contrib_type.populate_from_attrs(old_contrib_type, attrs)
         new_event.contribution_types.append(contrib_type)
         self._contrib_type_map[old_contrib_type] = contrib_type
Ejemplo n.º 3
0
 def _process(self):
     form = ContributionTypeForm(event=self.event)
     if form.validate_on_submit():
         contrib_type = ContributionType()
         form.populate_obj(contrib_type)
         self.event.contribution_types.append(contrib_type)
         db.session.flush()
         self.event.log(EventLogRealm.management, EventLogKind.positive, 'Contributions',
                        'Added type: {}'.format(contrib_type.name), session.user)
         return contribution_type_row(contrib_type)
     return jsonify_form(form)
Ejemplo n.º 4
0
 def _migrate_contribution_types(self):
     name_map = {}
     for old_ct in self.conf._contribTypes.itervalues():
         name = convert_to_unicode(old_ct._name)
         existing = name_map.get(name.lower())
         if existing is not None:
             self.print_warning('%[yellow]Duplicate contribution type name: {}'.format(name))
             self.event_ns.legacy_contribution_type_map[old_ct] = existing
             continue
         ct = ContributionType(name=name, description=convert_to_unicode(old_ct._description))
         name_map[name.lower()] = ct
         if not self.quiet:
             self.print_info('%[cyan]Contribution type%[reset] {}'.format(ct.name))
         self.event_ns.legacy_contribution_type_map[old_ct] = ct
         self.event.contribution_types.append(ct)
Ejemplo n.º 5
0
 def _process_args(self):
     RHManageContributionsBase._process_args(self)
     self.contrib_type = ContributionType.get_one(
         request.view_args['contrib_type_id'])
Ejemplo n.º 6
0
 def _create(event, name='Poster'):
     contrib_type = ContributionType(name=name, event=event)
     db.session.add(contrib_type)
     db.session.flush()
     return contrib_type
Ejemplo n.º 7
0
 def _process_args(self):
     RHManageContributionsBase._process_args(self)
     self.contrib_type = ContributionType.get_one(request.view_args['contrib_type_id'])
Ejemplo n.º 8
0
 def _checkParams(self, params):
     RHManageContributionsBase._checkParams(self, params)
     self.contrib_type = ContributionType.get_one(request.view_args['contrib_type_id'])
Ejemplo n.º 9
0
 def _checkParams(self, params):
     RHManageContributionsBase._checkParams(self, params)
     self.contrib_type = ContributionType.get_one(
         request.view_args['contrib_type_id'])