예제 #1
0
    def _process_args(self):
        data = request.json
        self.object = None
        if 'categId' in data:
            self.object = Category.get_one(data['categId'])
        elif 'contribId' in data:
            self.object = Contribution.get_one(data['contribId'])
        elif 'sessionId' in data:
            self.object = Session.get_one(data['sessionId'])
        elif 'confId' in data:
            self.object = Event.get_one(data['confId'])

        if self.object is None:
            raise BadRequest
예제 #2
0
def obj_deref(ref):
    """Returns the object identified by `ref`"""
    from indico_livesync.models.queue import EntryType
    if ref['type'] == EntryType.category:
        return Category.get_one(ref['category_id'])
    elif ref['type'] == EntryType.event:
        return Event.get_one(ref['event_id'])
    elif ref['type'] == EntryType.session:
        return Session.get_one(ref['session_id'])
    elif ref['type'] == EntryType.contribution:
        return Contribution.get_one(ref['contrib_id'])
    elif ref['type'] == EntryType.subcontribution:
        return SubContribution.get_one(ref['subcontrib_id'])
    else:
        raise ValueError('Unexpected object type: {}'.format(ref['type']))
예제 #3
0
 def _checkParams(self, params):
     RHConferenceBaseDisplay._checkParams(self, params)
     self.contrib = Contribution.get_one(request.view_args['contrib_id'], is_deleted=False)
예제 #4
0
파일: base.py 프로젝트: DirkHoffmann/indico
 def _process_args(self):
     RHPapersBase._process_args(self)
     self.contribution = Contribution.get_one(request.view_args['contrib_id'], is_deleted=False)
     self.paper = self.contribution.paper
     if self.paper is None and self.PAPER_REQUIRED:
         raise NotFound
예제 #5
0
 def _process_args(self):
     RHDisplayEventBase._process_args(self)
     self.contrib = Contribution.get_one(request.view_args['contrib_id'], is_deleted=False)
예제 #6
0
 def _process_args(self):
     RHConferenceBaseDisplay._process_args(self)
     self.contrib = Contribution.get_one(request.view_args['contrib_id'],
                                         is_deleted=False)
예제 #7
0
파일: display.py 프로젝트: pmart123/indico
 def _checkParams(self, params):
     RHConferenceBaseDisplay._checkParams(self, params)
     self.contrib = Contribution.get_one(request.view_args['contrib_id'],
                                         is_deleted=False)
예제 #8
0
파일: display.py 프로젝트: uxmaster/indico
 def _process_args(self):
     RHDisplayEventBase._process_args(self)
     self.contrib = Contribution.get_one(request.view_args['contrib_id'], is_deleted=False)
예제 #9
0
 def _process_args(self):
     RHPapersBase._process_args(self)
     self.contribution = Contribution.get_one(request.view_args['contrib_id'], is_deleted=False)
     self.paper = self.contribution.paper
     if self.paper is None and self.PAPER_REQUIRED:
         raise NotFound