Exemple #1
0
def _extend_event_management_menu(sender, event, **kwargs):
    if not get_agreement_definitions():
        return
    if not event.can_manage(session.user, allow_key=True):
        return
    return SideMenuItem('agreements', _('Agreements'), url_for('agreements.event_agreements', event),
                        section='services')
Exemple #2
0
def _extend_event_management_menu(sender, event, **kwargs):
    if not get_agreement_definitions():
        return
    if not event.can_manage(session.user):
        return
    return SideMenuItem('agreements', _('Agreements'), url_for('agreements.event_agreements', event),
                        section='services')
Exemple #3
0
def _extend_event_management_menu(sender, event, **kwargs):
    if not get_agreement_definitions():
        return
    if not event.can_manage(session.user):
        return
    return SideMenuItem(
        "agreements", _("Agreements"), url_for("agreements.event_agreements", event), section="services"
    )
Exemple #4
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     definition_name = request.view_args['definition']
     self.definition = get_agreement_definitions().get(definition_name)
     if self.definition is None:
         raise NotFound("Agreement type '{}' does not exist".format(definition_name))
     if not self.definition.is_active(self._conf):
         flash(_("The '{}' agreement is not used in this event.").format(self.definition.title), 'error')
         return redirect(url_for('.event_agreements', self._conf))
Exemple #5
0
 def _process_args(self):
     RHAgreementManagerBase._process_args(self)
     definition_name = request.view_args['definition']
     self.definition = get_agreement_definitions().get(definition_name)
     if self.definition is None:
         raise NotFound("Agreement type '{}' does not exist".format(definition_name))
     if not self.definition.is_active(self.event):
         flash(_("The '{}' agreement is not used in this event.").format(self.definition.title), 'error')
         return redirect(url_for('.event_agreements', self.event))
Exemple #6
0
 def _process_args(self):
     RHAgreementManagerBase._process_args(self)
     definition_name = request.view_args['definition']
     self.definition = get_agreement_definitions().get(definition_name)
     if self.definition is None:
         raise NotFound("Agreement type '{}' does not exist".format(definition_name))
     if not self.definition.is_active(self.event):
         flash(_("The '{}' agreement is not used in this event.").format(self.definition.title), 'error')
         return redirect(url_for('.event_agreements', self.event))
Exemple #7
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     definition_name = request.view_args['definition']
     self.definition = get_agreement_definitions().get(definition_name)
     if self.definition is None:
         raise NotFound("Agreement type '{}' does not exist".format(definition_name))
     if not self.definition.is_active(self._conf):
         flash(_("The '{}' agreement is not used in this event.").format(self.definition.title), 'error')
         return redirect(url_for('.event_agreements', self._conf))
Exemple #8
0
 def _getParams(self):
     super(AgreementExportHook, self)._getParams()
     type_ = self._pathParams['agreement_type']
     try:
         self._definition = get_agreement_definitions()[type_]
     except KeyError:
         raise HTTPAPIError('No such agreement type', 404)
     self.event = Event.get(self._pathParams['event_id'], is_deleted=False)
     if self.event is None:
         raise HTTPAPIError('No such event', 404)
Exemple #9
0
 def _getParams(self):
     super(AgreementExportHook, self)._getParams()
     type_ = self._pathParams['agreement_type']
     try:
         self._definition = get_agreement_definitions()[type_]
     except KeyError:
         raise HTTPAPIError('No such agreement type', 404)
     self.event = Event.get(self._pathParams['event_id'], is_deleted=False)
     if self.event is None:
         raise HTTPAPIError('No such event', 404)
Exemple #10
0
 def _getParams(self):
     super(AgreementExportHook, self)._getParams()
     type_ = self._pathParams['agreement_type']
     try:
         self._definition = get_agreement_definitions()[type_]
     except KeyError:
         raise HTTPAPIError('No such agreement type', 404)
     self._event = ConferenceHolder().getById(self._pathParams['event_id'], True)
     if self._event is None:
         raise HTTPAPIError('No such event', 404)
Exemple #11
0
 def _getParams(self):
     super(AgreementExportHook, self)._getParams()
     type_ = self._pathParams['agreement_type']
     try:
         self._definition = get_agreement_definitions()[type_]
     except KeyError:
         raise HTTPAPIError('No such agreement type', 404)
     self._event = ConferenceHolder().getById(self._pathParams['event_id'], True)
     if self._event is None:
         raise HTTPAPIError('No such event', 404)
Exemple #12
0
 def _process(self):
     definitions = get_agreement_definitions().values()
     return WPAgreementManager.render_template('agreement_types.html', self._conf,
                                               event=self._conf, definitions=definitions)
Exemple #13
0
    def definition(self):
        from indico.modules.events.agreements.util import get_agreement_definitions

        return get_agreement_definitions().get(self.type)
Exemple #14
0
def _extend_event_management_menu(event, **kwargs):
    return 'agreements', SideMenuItem('Agreements',
                                      url_for('agreements.event_agreements',
                                              event),
                                      visible=bool(get_agreement_definitions())
                                      and event.canModify(session.avatar))
Exemple #15
0
def _check_agreement_definitions(app, **kwargs):
    # This will raise RuntimeError if the agreement definition types are not unique
    get_agreement_definitions()
Exemple #16
0
def _extend_event_management_menu(event, **kwargs):
    return 'agreements', SideMenuItem('Agreements', url_for('agreements.event_agreements', event),
                                      visible=bool(get_agreement_definitions()) and event.canModify(session.user))
Exemple #17
0
 def _process(self):
     definitions = get_agreement_definitions().values()
     return WPAgreementManager.render_template('agreement_types.html', self.event, definitions=definitions)
Exemple #18
0
def _check_agreement_definitions(app, **kwargs):
    # This will raise RuntimeError if the agreement definition types are not unique
    get_agreement_definitions()
Exemple #19
0
 def definition(self):
     from indico.modules.events.agreements.util import get_agreement_definitions
     return get_agreement_definitions().get(self.type)