Example #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')
Example #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')
Example #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"
    )
Example #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))
Example #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))
Example #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))
Example #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))
Example #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)
Example #9
0
File: api.py Project: OmeGak/indico
 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)
Example #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)
Example #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)
Example #12
0
 def _process(self):
     definitions = get_agreement_definitions().values()
     return WPAgreementManager.render_template('agreement_types.html', self._conf,
                                               event=self._conf, definitions=definitions)
Example #13
0
    def definition(self):
        from indico.modules.events.agreements.util import get_agreement_definitions

        return get_agreement_definitions().get(self.type)
Example #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))
Example #15
0
def _check_agreement_definitions(app, **kwargs):
    # This will raise RuntimeError if the agreement definition types are not unique
    get_agreement_definitions()
Example #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))
Example #17
0
 def _process(self):
     definitions = get_agreement_definitions().values()
     return WPAgreementManager.render_template('agreement_types.html', self.event, definitions=definitions)
Example #18
0
def _check_agreement_definitions(app, **kwargs):
    # This will raise RuntimeError if the agreement definition types are not unique
    get_agreement_definitions()
Example #19
0
 def definition(self):
     from indico.modules.events.agreements.util import get_agreement_definitions
     return get_agreement_definitions().get(self.type)