Example #1
0
 def _migrate_settings(self):
     start_dt = self._naive_to_aware(self.amgr._submissionStartDate)
     end_dt = self._naive_to_aware(self.amgr._submissionEndDate)
     modification_end_dt = (self._naive_to_aware(self.amgr._modifDeadline)
                            if getattr(self.amgr, '_modifDeadline', None)
                            else None)
     assert start_dt < end_dt
     if modification_end_dt and modification_end_dt - end_dt < timedelta(minutes=1):
         if modification_end_dt != end_dt:
             self.print_warning('Ignoring mod deadline ({} > {})'.format(end_dt, modification_end_dt))
         modification_end_dt = None
     abstracts_settings.set_multi(self.event, {
         'start_dt': start_dt,
         'end_dt': end_dt,
         'modification_end_dt': modification_end_dt,
         'announcement': convert_to_unicode(self.amgr._announcement),
         'announcement_render_mode': RenderMode.html,
         'allow_multiple_tracks': bool(getattr(self.amgr, '_multipleTracks', True)),
         'tracks_required': bool(getattr(self.amgr, '_tracksMandatory', False)),
         'allow_attachments': bool(getattr(self.amgr, '_attachFiles', False)),
         'allow_speakers': bool(getattr(self.amgr, '_showSelectAsSpeaker', True)),
         'speakers_required': bool(getattr(self.amgr, '_selectSpeakerMandatory', True)),
         'authorized_submitters': set(filter(None, map(self.user_from_legacy,
                                                       getattr(self.amgr, '_authorizedSubmitter', []))))
     })
Example #2
0
 def schedule(self, start_dt, end_dt, modification_end_dt):
     abstracts_settings.set_multi(
         self.event, {
             'start_dt': start_dt,
             'end_dt': end_dt,
             'modification_end_dt': modification_end_dt
         })
Example #3
0
 def _migrate_settings(self):
     start_dt = self._event_to_utc(self.amgr._submissionStartDate)
     end_dt = self._event_to_utc(self.amgr._submissionEndDate)
     modification_end_dt = (self._event_to_utc(self.amgr._modifDeadline)
                            if getattr(self.amgr, '_modifDeadline', None)
                            else None)
     assert start_dt < end_dt
     if modification_end_dt and modification_end_dt - end_dt < timedelta(minutes=1):
         if modification_end_dt != end_dt:
             self.importer.print_warning('Ignoring mod deadline ({} > {})'.format(end_dt, modification_end_dt),
                                         event_id=self.event.id)
         modification_end_dt = None
     abstracts_settings.set_multi(self.event, {
         'start_dt': start_dt,
         'end_dt': end_dt,
         'modification_end_dt': modification_end_dt,
         'announcement': convert_to_unicode(self.amgr._announcement),
         'announcement_render_mode': RenderMode.html,
         'allow_multiple_tracks': bool(getattr(self.amgr, '_multipleTracks', True)),
         'tracks_required': bool(getattr(self.amgr, '_tracksMandatory', False)),
         'allow_attachments': bool(getattr(self.amgr, '_attachFiles', False)),
         'allow_speakers': bool(getattr(self.amgr, '_showSelectAsSpeaker', True)),
         'speakers_required': bool(getattr(self.amgr, '_selectSpeakerMandatory', True)),
         'authorized_submitters': set(filter(None, map(self._user_from_legacy, self.amgr._authorizedSubmitter)))
     })
Example #4
0
 def open(self):
     if self.has_ended:
         abstracts_settings.set_multi(self.event, {
             'end_dt': None,
             'modification_end_dt': None
         })
     else:
         abstracts_settings.set(self.event, 'start_dt', now_utc(False))
Example #5
0
 def open(self):
     if self.has_ended:
         abstracts_settings.set_multi(self.event, {
             'end_dt': None,
             'modification_end_dt': None
         })
     else:
         abstracts_settings.set(self.event, 'start_dt', now_utc(False))
Example #6
0
 def _clone_settings(self, new_event):
     old_settings = abstracts_settings.get_all(self.old_event, no_defaults=True)
     offset = new_event.start_dt - self.old_event.start_dt
     for key in ('start_dt', 'end_dt', 'modification_end_dt'):
         if not old_settings.get(key):
             continue
         old_settings[key] += offset
     abstracts_settings.set_multi(new_event, old_settings)
     abstracts_reviewing_settings.set_multi(new_event, abstracts_reviewing_settings.get_all(self.old_event,
                                                                                            no_defaults=True))
     boa_settings.set_multi(new_event, boa_settings.get_all(self.old_event, no_defaults=True))
Example #7
0
 def _clone_settings(self, new_event):
     old_settings = abstracts_settings.get_all(self.old_event, no_defaults=True)
     offset = new_event.start_dt - self.old_event.start_dt
     for key in ('start_dt', 'end_dt', 'modification_end_dt'):
         if not old_settings.get(key):
             continue
         old_settings[key] += offset
     abstracts_settings.set_multi(new_event, old_settings)
     abstracts_reviewing_settings.set_multi(new_event, abstracts_reviewing_settings.get_all(self.old_event,
                                                                                            no_defaults=True))
     boa_settings.set_multi(new_event, boa_settings.get_all(self.old_event, no_defaults=True))
Example #8
0
 def _process(self):
     settings = abstracts_settings.get_all(self.event)
     form = AbstractSubmissionSettingsForm(event=self.event, obj=FormDefaults(**settings))
     if form.validate_on_submit():
         abstracts_settings.set_multi(self.event, form.data)
         flash(_('Abstract submission settings have been saved'), 'success')
         return jsonify_data()
     elif not form.is_submitted():
         handle_legacy_description(form.announcement, settings,
                                   get_render_mode=itemgetter('announcement_render_mode'),
                                   get_value=itemgetter('announcement'))
     return jsonify_form(form)
Example #9
0
 def _process(self):
     settings = abstracts_settings.get_all(self.event)
     form = AbstractSubmissionSettingsForm(event=self.event, obj=FormDefaults(**settings))
     if form.validate_on_submit():
         abstracts_settings.set_multi(self.event, form.data)
         flash(_('Abstract submission settings have been saved'), 'success')
         return jsonify_data()
     elif not form.is_submitted():
         handle_legacy_description(form.announcement, settings,
                                   get_render_mode=itemgetter('announcement_render_mode'),
                                   get_value=itemgetter('announcement'))
     return jsonify_form(form)
Example #10
0
 def open(self):
     if self.has_ended:
         abstracts_settings.set_multi(self.event, {"end_dt": None, "modification_end_dt": None})
     else:
         abstracts_settings.set(self.event, "start_dt", now_utc(False))
Example #11
0
 def schedule(self, start_dt, end_dt, modification_end_dt):
     abstracts_settings.set_multi(
         self.event, {"start_dt": start_dt, "end_dt": end_dt, "modification_end_dt": modification_end_dt}
     )
Example #12
0
 def schedule(self, start_dt, end_dt, modification_end_dt):
     abstracts_settings.set_multi(self.event, {
         'start_dt': start_dt,
         'end_dt': end_dt,
         'modification_end_dt': modification_end_dt
     })