예제 #1
0
파일: error.py 프로젝트: bubbas/indico
 def _checkParams(self):
     pManager = ParameterManager(self._params)
     self._userMail = pManager.extract("userMail", pType=str, allowEmpty=True)
     self._code = pManager.extract("code", pType=str, allowEmpty=True)
     self._message = pManager.extract("message", pType=str, allowEmpty=True)
     self._inner = pManager.extract("inner", pType=str, allowEmpty=True)
     self._requestInfo = pManager.extract("requestInfo", pType=dict)
예제 #2
0
 def _checkParams(self):
     CategoryControlUserListBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._principals = [
         principal_from_fossil(f, allow_pending=True) for f in pm.extract("userList", pType=list, allowEmpty=False)
     ]
     self._sendEmailManagers = pm.extract("sendEmailManagers", pType=bool, allowEmpty=True, defaultValue=True)
예제 #3
0
    def _checkParams(self):
        """
        Gets a reference to the material, using the
        id as the key, and gets the properties to change
        """
        MaterialModifBase._checkParams(self)

        matId = self._params.get("materialId", None)
        self._newProperties = self._params.get("materialInfo", None)
        self._newUserList = self._newProperties['userList']

        materialPM = ParameterManager(self._newProperties)

        self._title = materialPM.extract('title',
                                         pType=str,
                                         allowEmpty=True,
                                         defaultValue="NO TITLE ASSIGNED")
        self._description = materialPM.extract('description',
                                               pType=str,
                                               allowEmpty=True)
        self._protection = materialPM.extract('protection', pType=int)
        self._hidden = materialPM.extract('hidden', pType=int)
        self._accessKey = materialPM.extract('accessKey',
                                             pType=str,
                                             allowEmpty=True)
예제 #4
0
 def _checkParams(self):
     ConferenceReviewingPRMBase._checkParams(self)
     self._dueDateToChange = self._params.get("dueDateToChange")
     pm = ParameterManager(self._params.get('value'),
                           timezone=self._conf.getTimezone())
     self._date = pm.extract('date', pType=datetime.datetime)
     self._apply = pm.extract('applyToContributions', pType=bool)
예제 #5
0
 def _checkParams(self):
     AbstractReviewingBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._trackId = pm.extract("track", pType=str, allowEmpty=False)
     self._reviewerId = pm.extract("userId", pType=str, allowEmpty=True, defaultValue=None)
     if (self._reviewerId == None):
         self._reviewerId = pm.extract("user", pType=str, allowEmpty=False)
예제 #6
0
    def _checkParams_POST(self):
        defaultArrivalOffset = [-2, 0]
        defaultDepartureOffset = [1, 3]

        post_pm = ParameterManager(decode(request.data))
        self._arrivalOffsetDates = post_pm.extract(
            'arrivalOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultArrivalOffset)
        self._departureOffsetDates = post_pm.extract(
            'departureOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultDepartureOffset)
        self._items = post_pm.extract('items', pType=list, allowEmpty=False)

        if (len(self._arrivalOffsetDates) != 2
                or self._arrivalOffsetDates[0] == ''
                or self._arrivalOffsetDates[1] == ''):
            self._arrivalOffsetDates = defaultArrivalOffset
        if (len(self._departureOffsetDates) != 2
                or self._departureOffsetDates[0] == ''
                or self._departureOffsetDates[1] == ''):
            self._departureOffsetDates = defaultDepartureOffset
예제 #7
0
 def _checkParams(self):
     ConferenceChairPersonBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._userData = pm.extract("userData", pType=dict, allowEmpty=False)
     self._chairId = pm.extract("userId", pType=str, allowEmpty=False)
     if self._userData.get("email", "") != "" and self._isEmailAlreadyUsed():
         raise ServiceAccessError(_("The email address is already used by another chairperson. Chairperson not modified."))
예제 #8
0
    def _checkParams(self):
        ConferenceListModificationBase._checkParams(self)
        pm = ParameterManager(self._params)
        self._selTypes = pm.extract("selTypes",
                                    pType=list,
                                    allowEmpty=True,
                                    defaultValue=[])  # ids of selected types
        self._selTracks = pm.extract("selTracks",
                                     pType=list,
                                     allowEmpty=True,
                                     defaultValue=[])  # ids of selected tracks
        self._selSessions = pm.extract(
            "selSessions", pType=list, allowEmpty=True,
            defaultValue=[])  # ids of selected sessions

        self._typeShowNoValue = self._params.get("typeShowNoValue", True)
        self._trackShowNoValue = self._params.get("trackShowNoValue", True)
        self._sessionShowNoValue = self._params.get("sessionShowNoValue", True)

        self._showWithoutTeam = self._params.get("showWithoutTeam", True)
        self._showWithReferee = self._params.get("showWithReferee", False)
        self._showWithEditor = self._params.get("showWithEditor", False)
        self._showWithReviewer = self._params.get("showWithReviewer", False)

        self._showWithMaterial = self._params.get("showWithMaterial", False)
        self._showWithoutMaterial = self._params.get("showWithoutMaterial",
                                                     False)
예제 #9
0
 def _checkParams(self):
     AbstractReviewingBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._trackId = pm.extract("track", pType=str, allowEmpty=False)
     self._reviewerList = pm.extract("userList",
                                     pType=list,
                                     allowEmpty=False)
    def _checkParams_POST(self):
        defaultArrivalOffset = [-2, 0]
        defaultDepartureOffset = [1, 3]

        post_pm = ParameterManager(decode(request.data))
        self._arrivalOffsetDates = post_pm.extract(
            'arrivalOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultArrivalOffset)
        self._departureOffsetDates = post_pm.extract(
            'departureOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultDepartureOffset)
        self._items = post_pm.extract('items', pType=list, allowEmpty=False)

        if (len(self._arrivalOffsetDates) != 2 or
                self._arrivalOffsetDates[0] == '' or
                self._arrivalOffsetDates[1] == ''):
            self._arrivalOffsetDates = defaultArrivalOffset
        if (len(self._departureOffsetDates) != 2 or
                self._departureOffsetDates[0] == '' or
                self._departureOffsetDates[1] == ''):
            self._departureOffsetDates = defaultDepartureOffset
예제 #11
0
 def _checkParams(self):
     ConferenceModifBase._checkParams(self)
     pm = ParameterManager(self._params)
     submitterId = pm.extract("submitterId", pType=str, allowEmpty=False)
     abstractId = pm.extract("abstractId", pType=str, allowEmpty=False)
     self._abstract = self._conf.getAbstractMgr().getAbstractById(abstractId)
     self._submitter = user.AvatarHolder().getById(submitterId)
예제 #12
0
 def _checkParams(self):
     AbstractReviewingBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._trackId = pm.extract("track", pType=str, allowEmpty=False)
     self._reviewerId = pm.extract("userId", pType=str, allowEmpty=True, defaultValue=None)
     if (self._reviewerId == None):
         self._reviewerId = pm.extract("user", pType=str, allowEmpty=False)
예제 #13
0
파일: services.py 프로젝트: Ictp/indico
 def _checkParams(self):
     CollaborationBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._bookingType = pm.extract("type", pType=str, allowEmpty=False)
     self._query = pm.extract("query", pType=str, allowEmpty=False)
     self._limit = pm.extract("limit", pType=int, allowEmpty=True, defaultValue=None)
     self._offset = pm.extract("offset", pType=int, allowEmpty=True, defaultValue=0)
예제 #14
0
파일: error.py 프로젝트: arturodr/indico
 def _checkParams(self):
     pManager = ParameterManager(self._params)
     self._userMail = pManager.extract("userMail", pType=str, allowEmpty=True)
     self._code = pManager.extract("code", pType=str, allowEmpty=True)
     self._message = pManager.extract("message", pType=str, allowEmpty=True)
     self._inner = pManager.extract("inner", pType=str, allowEmpty=True)
     self._requestInfo = pManager.extract("requestInfo", pType=dict)
예제 #15
0
 def _checkParams(self):
     CategoryControlUserListBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._userList = pm.extract("userList", pType=list, allowEmpty=False)
     self._sendEmailManagers = pm.extract("sendEmailManagers",
                                          pType=bool,
                                          allowEmpty=True,
                                          defaultValue=True)
예제 #16
0
파일: error.py 프로젝트: k3njiy/indico
 def _checkParams(self):
     pManager = ParameterManager(self._params)
     self._userMail = pManager.extract("userMail", pType=str, allowEmpty=True)
     self._code = pManager.extract("code", pType=str, allowEmpty=True)
     self._message = pManager.extract("message", pType=str, allowEmpty=True)
     inner = self._params.get('inner', '')
     self._inner = '\n'.join(inner) if isinstance(inner, list) else inner
     self._requestInfo = pManager.extract("requestInfo", pType=dict)
예제 #17
0
 def _checkParams(self):
     AbstractReviewingBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._value = pm.extract("value", pType=str,
                              allowEmpty=False)  # value is the question id
     self._keepJud = pm.extract(
         "keepJud", pType=bool,
         allowEmpty=False)  # keep the previous judgements of the question
예제 #18
0
파일: handlers.py 프로젝트: arturodr/indico
class AgentModificationService(AdminService):
    def _checkParams(self):
        self._pm = ParameterManager(self._params)

        self._id = self._pm.extract('id', pType=str)
        self._name = self._pm.extract('name', pType=str)
        self._description = self._pm.extract('description', pType=str)
        self._specificParams = self._params['specific']
예제 #19
0
 def _checkParams(self):
     pm = ParameterManager(self._params)
     self._reportNumber = pm.extract("reportNumber",
                                     pType=str,
                                     allowEmpty=False)
     self._reportNumberSystem = pm.extract("reportNumberSystem",
                                           pType=str,
                                           allowEmpty=False)
예제 #20
0
class AgentModificationService(AdminService):
    def _checkParams(self):
        self._pm = ParameterManager(self._params)

        self._id = self._pm.extract("id", pType=str)
        self._name = self._pm.extract("name", pType=str)
        self._description = self._pm.extract("description", pType=str)
        self._specificParams = self._params["specific"]
예제 #21
0
 def _checkParams(self):
     SessionChairListBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._chairId = pm.extract("userId", pType=str, allowEmpty=False)
     self._kindOfUser = pm.extract("kindOfUser",
                                   pType=str,
                                   allowEmpty=True,
                                   defaultValue=None)
예제 #22
0
    def _checkParams(self):

        ConferenceModifBase._checkParams(self)

        pm = ParameterManager(self._params.get("value"), timezone=self._conf.getTimezone())

        self._startDate = pm.extract("startDate", pType=datetime.datetime)
        self._endDate = pm.extract("endDate", pType=datetime.datetime)
예제 #23
0
    def _checkParams(self):
        AdminService._checkParams(self)

        pm = ParameterManager(self._params)

        self._title = pm.extract("title", pType=str, allowEmpty=False)
        self._type = pm.extract("type", pType=str, allowEmpty=False)
        self._content = pm.extract("content", pType=str, allowEmpty=True)
예제 #24
0
 def _checkParams(self):
     params = self._params or {}  # if params is not specified it's an empty list
     pManager = ParameterManager(params)
     self._userMail = pManager.extract("userMail", pType=str, allowEmpty=True)
     self._code = pManager.extract("code", pType=str, allowEmpty=True)
     self._message = pManager.extract("message", pType=str, allowEmpty=True)
     inner = params.get("inner", "")
     self._inner = "\n".join(inner) if isinstance(inner, list) else inner
     self._requestInfo = pManager.extract("requestInfo", pType=dict, allowEmpty=True)
예제 #25
0
    def _checkParams(self):

        ConferenceModifBase._checkParams(self)

        pm = ParameterManager(self._params.get('value'),
                              timezone=self._conf.getTimezone())

        self._startDate = pm.extract('startDate', pType=datetime.datetime)
        self._endDate = pm.extract('endDate', pType=datetime.datetime)
예제 #26
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionHeader = {}
     self._sectionHeader["title"] = post_pm.extract('title',
                                                    pType=str,
                                                    allowEmpty=False)
     self._sectionHeader["description"] = post_pm.extract('description',
                                                          pType=str,
                                                          allowEmpty=True)
예제 #27
0
파일: error.py 프로젝트: wtakase/indico
 def _checkParams(self):
     params = self._params or {}  # if params is not specified it's an empty list
     pManager = ParameterManager(params)
     self._userMail = pManager.extract("userMail", pType=str, allowEmpty=True)
     self._code = pManager.extract("code", pType=str, allowEmpty=True)
     self._message = pManager.extract("message", pType=str, allowEmpty=True)
     inner = params.get('inner', '')
     self._inner = '\n'.join(inner) if isinstance(inner, list) else inner
     self._requestInfo = pManager.extract("requestInfo", pType=dict, allowEmpty=True)
예제 #28
0
파일: services.py 프로젝트: arturodr/indico
class SendElectronicAgreement(ConferenceModifBase):

    def _checkParams(self):
        ConferenceModifBase._checkParams(self)

        self._pm = ParameterManager(self._params)
        self.uniqueIdList = self._pm.extract("uniqueIdList", list, False, [])
        fromMail = self._pm.extract("from", dict, False, {})
        self.fromEmail = fromMail['email']
        self.fromName = fromMail['name']
        self.content = self._pm.extract("content", str, False, "")
        p_cc = self._pm.extract("cc", str, True, "").strip()
        self.cc = setValidEmailSeparators(p_cc).split(',') if p_cc else []
        self.emailToList = []
        manager = self._conf.getCSBookingManager()
        for uniqueId in self.uniqueIdList:
            spk = manager.getSpeakerWrapperByUniqueId(uniqueId)
            if spk.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]:
                self.emailToList.extend(manager.getSpeakerEmailByUniqueId(uniqueId, self._aw.getUser()))

    def processContent(self, speakerWrapper):
        fullUrl = UHCollaborationElectronicAgreementForm().getURL(self._conf.getId(), speakerWrapper.getUniqueIdHash())
        url = "<a href='%s'>%s</a>"%(fullUrl, fullUrl)

        talkTitle = speakerWrapper.getContribution().getTitle() if speakerWrapper.getContribution() else self._conf.getTitle()

        mailEnv = dict(url=url, talkTitle = talkTitle, name= speakerWrapper.getObject().getDirectFullName())
        return permissive_format(self.content, mailEnv)

    def _getAnswer(self):
        report = ""
        i = 0
        for email in self.emailToList:
            i += 1
            if i != len(self.emailToList):
                report += "%s, "%email
            else:
                report += "%s."%email

        #{url} and {talkTitle} are mandatory to send the EA link
        if self.content.find('{url}') == -1:
            report = "url_error"
        elif self.content.find('{talkTitle}') == -1:
            report = "talkTitle_error"
        else:
            manager = self._conf.getCSBookingManager()
            for uniqueId in self.uniqueIdList:
                sw = manager.getSpeakerWrapperByUniqueId(uniqueId)
                if sw.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]:
                    sw.setStatus(SpeakerStatusEnum.PENDING)
                    subject = """[Indico] Electronic Agreement: '%s'"""%(self._conf.getTitle())
                    notification = ElectronicAgreementNotification([sw.getObject().getEmail()], self.cc, self.fromEmail, self.fromName, self.processContent(sw), subject)

                    GenericMailer.sendAndLog(notification, self._conf,
                                             "MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py",
                                             None)
        return report
예제 #29
0
 def _checkParams(self):
     ConferenceModifBase._checkParams(self)
     pm = ParameterManager(self._params)
     submitterId = pm.extract("submitterId", pType=str, allowEmpty=False)
     abstractId = pm.extract("abstractId", pType=str, allowEmpty=False)
     self._abstract = self._conf.getAbstractMgr().getAbstractById(abstractId)
     self._submitter = user.AvatarHolder().getById(submitterId)
     if self._submitter is None:
         raise NoReportError(_("The user that you are changing does not exist anymore in the database"))
예제 #30
0
    def _checkParams(self):
        ServiceBase._checkParams(self)

        pm = ParameterManager(self._params)

        self._tz = pm.extract("timezone", pType=str, allowEmpty=False)
        pm.setTimezone(self._tz)
        self._sDate = pm.extract("sDate", pType=datetime.datetime, allowEmpty=False)
        self._eDate = pm.extract("eDate", pType=datetime.datetime, allowEmpty=False)
예제 #31
0
 def _checkParams(self):
     ConferenceModifBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._chairperson = self._conf.getChairById(pm.extract("userId", pType=str, allowEmpty=False))
     if self._chairperson == None:
         raise ServiceAccessError(_("The user that you are trying to delete does not exist."))
     if self._chairperson.getEmail() == "":
         raise ServiceAccessError(_("It is not possible to grant submission rights to a participant without an email address. Please set an email address."))
     self._action = pm.extract("action", pType=str, allowEmpty=False)
예제 #32
0
파일: handlers.py 프로젝트: Ictp/indico
class AgentModificationService(AdminService):

    def _checkParams(self):
        self._pm = ParameterManager(self._params)

        self._id = self._pm.extract('id', pType=str)
        self._name = self._pm.extract('name', pType=str)
        self._description = self._pm.extract('description', pType=str)
        self._specificParams = self._params['specific']
예제 #33
0
 def _checkParams(self):
     ConferenceChairPersonBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._userList = pm.extract("userList", pType=list, allowEmpty=False)
     self._submissionRights = pm.extract("presenter-grant-submission", pType=bool, allowEmpty=False)
     # Check if there is already a user with the same email
     for person in self._userList:
         if self._isEmailAlreadyUsed(person["email"]):
             raise ServiceAccessError(_("A user with the email address %s is already in the Chairpersons list. Chairperson(s) not added.") % person["email"])
예제 #34
0
파일: services.py 프로젝트: jbenito3/indico
class SendElectronicAgreement(ConferenceModifBase):
    def _checkParams(self):
        ConferenceModifBase._checkParams(self)

        self._pm = ParameterManager(self._params)
        self.uniqueIdList = self._pm.extract("uniqueIdList", list, False, [])
        fromMail = self._pm.extract("from", dict, False, {})
        self.fromEmail = fromMail["email"]
        self.fromName = fromMail["name"]
        self.content = self._pm.extract("content", str, False, "")
        p_cc = self._pm.extract("cc", str, True, "").strip()
        self.cc = setValidEmailSeparators(p_cc).split(",") if p_cc else []
        self.emailToList = []
        manager = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId())
        for uniqueId in self.uniqueIdList:
            spk = manager.getSpeakerWrapperByUniqueId(uniqueId)
            if spk.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]:
                self.emailToList.extend(manager.getSpeakerEmailByUniqueId(uniqueId, self._aw.getUser()))

    def processContent(self, speakerWrapper):
        fullUrl = UHCollaborationElectronicAgreementForm().getURL(self._conf.getId(), speakerWrapper.getUniqueIdHash())
        url = "<a href='%s'>%s</a>" % (fullUrl, fullUrl)

        talkTitle = (
            speakerWrapper.getContribution().getTitle() if speakerWrapper.getContribution() else self._conf.getTitle()
        )

        mailEnv = dict(url=url, talkTitle=talkTitle, name=speakerWrapper.getObject().getDirectFullName())
        return permissive_format(self.content, mailEnv)

    def _getAnswer(self):
        report = ", ".join(self.emailToList) + "."

        # {url} and {talkTitle} are mandatory to send the EA link
        if self.content.find("{url}") == -1:
            report = "url_error"
        elif self.content.find("{talkTitle}") == -1:
            report = "talkTitle_error"
        else:
            manager = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId())
            for uniqueId in self.uniqueIdList:
                sw = manager.getSpeakerWrapperByUniqueId(uniqueId)
                if sw.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]:
                    sw.setStatus(SpeakerStatusEnum.PENDING)
                    subject = """[Indico] Electronic Agreement: '%s'""" % (self._conf.getTitle())
                    notification = ElectronicAgreementNotification(
                        [sw.getObject().getEmail()],
                        self.cc,
                        self.fromEmail,
                        self.fromName,
                        self.processContent(sw),
                        subject,
                    )

                    GenericMailer.sendAndLog(notification, self._conf, MODULE_NAME)
        return report
예제 #35
0
파일: handlers.py 프로젝트: Ictp/indico
    def _checkParams(self):
        pm = ParameterManager(self._params)
        self._conferenceID = pm.extract("conference", pType=str, allowEmpty = False)
        self._target = ConferenceHolder().getById(self._conferenceID)

        pm = ParameterManager(self._params.get('chatroomParams'))
        self._title = pm.extract('title', pType=str, allowEmpty = False)
        self._createdInLocalServer = pm.extract('createdInLocalServer', pType=bool, allowEmpty = True)

        self._showRoom = pm.extract('showRoom', pType=bool, allowEmpty = True)
예제 #36
0
파일: conference.py 프로젝트: nyimbi/indico
    def _checkParams(self):
        ConferenceModifBase._checkParams(self)

        pm = ParameterManager(self._params.get('value'), timezone=self._conf.getTimezone())

        try:
            self._startDate = pm.extract('startDate', pType=datetime.datetime)
            self._endDate = pm.extract('endDate', pType=datetime.datetime)
        except ValueError, e:
            raise NoReportError("Warning", e.message)
예제 #37
0
    def _checkParams(self):
        pm = ParameterManager(self._params)
        self._conferenceID = pm.extract("conference", pType=str, allowEmpty = False)
        self._target = ConferenceHolder().getById(self._conferenceID)

        pm = ParameterManager(self._params.get('chatroomParams'))
        self._title = pm.extract('title', pType=str, allowEmpty = False)
        self._createdInLocalServer = pm.extract('createdInLocalServer', pType=bool, allowEmpty = True)

        self._showRoom = pm.extract('showRoom', pType=bool, allowEmpty = True)
예제 #38
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._introSentence = post_pm.extract('introSentence',
                                           pType=str,
                                           allowEmpty=False)
     self._selectionType = post_pm.extract('selectionType',
                                           pType=str,
                                           allowEmpty=False)
     self._items = post_pm.extract('items', pType=list, allowEmpty=False)
     self._mandatory = post_pm.extract('mandatory', pType=bool)
예제 #39
0
파일: conference.py 프로젝트: fph/indico
    def _checkParams(self):
        ConferenceModifBase._checkParams(self)

        pm = ParameterManager(self._params.get('value'), timezone=self._conf.getTimezone())

        try:
            self._startDate = pm.extract('startDate', pType=datetime.datetime)
            self._endDate = pm.extract('endDate', pType=datetime.datetime)
        except ValueError, e:
            raise NoReportError("Warning", e.message)
예제 #40
0
 def _checkParams(self):
     CategoryControlUserListBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._principals = [
         principal_from_fossil(f, allow_pending=True)
         for f in pm.extract("userList", pType=list, allowEmpty=False)
     ]
     self._sendEmailManagers = pm.extract("sendEmailManagers",
                                          pType=bool,
                                          allowEmpty=True,
                                          defaultValue=True)
예제 #41
0
 def _checkParams(self):
     CollaborationBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._bookingType = pm.extract("type", pType=str, allowEmpty=False)
     self._query = pm.extract("query", pType=str, allowEmpty=False)
     self._limit = pm.extract("limit",
                              pType=int,
                              allowEmpty=True,
                              defaultValue=None)
     self._offset = pm.extract("offset",
                               pType=int,
                               allowEmpty=True,
                               defaultValue=0)
예제 #42
0
    def _checkParams(self):
        ServiceBase._checkParams(self)

        pm = ParameterManager(self._params)

        self._tz = pm.extract("timezone", pType=str, allowEmpty=False)
        pm.setTimezone(self._tz)
        self._sDate = pm.extract("sDate",
                                 pType=datetime.datetime,
                                 allowEmpty=False)
        self._eDate = pm.extract("eDate",
                                 pType=datetime.datetime,
                                 allowEmpty=False)
예제 #43
0
 def _checkParams(self):
     AdminService._checkParams(self)
     pm = ParameterManager(self._params)
     self._userId = pm.extract("userId", pType=str, allowEmpty=False)
     self._av = AvatarHolder().getById(self._userId)
     if self._av == None:
         raise ServiceError("ER-U0", _("Cannot find user with id %s") % self._userId)
예제 #44
0
class ContributionParticipantsBase(ContributionModifBase):

    def _checkParams(self):
        ContributionModifBase._checkParams(self)
        self._pm = ParameterManager(self._params)
        self._kindOfList = self._pm.extract("kindOfList", pType=str, allowEmpty=False)

    def _isEmailAlreadyUsed(self, email):
        participantList = []
        if self._kindOfList in ("prAuthor", "coAuthor"):
            participantList = self._contribution.getPrimaryAuthorList() + self._contribution.getCoAuthorList()
        elif self._kindOfList == "speaker":
            participantList = self._contribution.getSpeakerList()

        for part in participantList:
            if email == part.getEmail():
                return True
        return False

    def _getParticipantsList(self, participantList):
        result = []
        for part in participantList:
            partFossil = fossilize(part)
            # var to control if we have to show the entry in the author menu to allow add submission rights
            isSubmitter = False
            av = AvatarHolder().match({"email": part.getEmail()}, searchInAuthenticators=False, exact=True)
            if not av:
                if part.getEmail() in self._contribution.getSubmitterEmailList():
                    isSubmitter = True
            elif (av[0] in self._contribution.getSubmitterList() or self._conf.getPendingQueuesMgr().isPendingSubmitter(part)):
                isSubmitter = True
            partFossil["showSubmitterCB"] = not isSubmitter
            result.append(partFossil)
        return result
예제 #45
0
파일: user.py 프로젝트: bubbas/indico
 def _checkParams(self):
     pm = ParameterManager(self._params)
     userId = pm.extract("userId", str, False, "")
     self._currentUser = self.getAW().getUser()
     self._target = self._avatar = user.AvatarHolder().getById(userId)
     if self._target == None:
         raise ServiceAccessError((_("The user with does not exist")))
예제 #46
0
 def _checkParams(self):
     AbstractReviewingBase._checkParams(self)
     pm = ParameterManager(self._params)
     # we need to do like this because the value sent is an str (inherit of InlineEditWidget)
     self._value = pm.extract("value", pType=dict, allowEmpty=False)
     self._min = int(self._value["min"])
     self._max = int(self._value["max"])
예제 #47
0
파일: user.py 프로젝트: dbourillot/indico
class UserPersonalDataBase(UserModifyBase):

    _dataTypes = ["title", "surName", "name", "fullName", "straightFullName", "organisation",
                  "email", "secondaryEmails", "address", "telephone", "fax"]

    def _checkParams(self):
        self._pm = ParameterManager(self._params)
        userId = self._pm.extract("userId", None)
        if userId is not None:
            ah = AvatarHolder()
            self._user = self._avatar = self._target = ah.getById(userId)
        else:
            raise ServiceError("ERR-U5", _("User id not specified"))
        self._dataType = self._pm.extract("dataType", pType=str, allowEmpty=False)
        if self._dataType not in self._dataTypes:
            raise ServiceError("ERR-U7", _("Data argument is not valid"))
예제 #48
0
 def _checkParams(self):
     ConferenceModifBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._principals = [
         principal_from_fossil(f, allow_pending=True, legacy=False)
         for f in pm.extract("userList", pType=list, allowEmpty=False)
     ]
예제 #49
0
class AgentOperationBase(AdminService):
    def _checkParams(self):
        self._pm = ParameterManager(self._params)
        AdminService._checkParams(self)
        self._id = self._pm.extract("id", pType=str)
        self._sm = SyncManager.getDBInstance()
        self._agent = self._sm.getAllAgents()[self._id]
예제 #50
0
 def _checkParams(self):
     SessionChairListBase._checkParams(self)
     pm = ParameterManager(self._params)
     self._principals = [
         principal_from_fossil(f, allow_pending=True)
         for f in pm.extract("userList", pType=list, allowEmpty=False)
     ]
예제 #51
0
class ContributionParticipantsBase(ContributionModifBase):

    def _checkParams(self):
        ContributionModifBase._checkParams(self)
        self._pm = ParameterManager(self._params)
        self._kindOfList = self._pm.extract("kindOfList", pType=str, allowEmpty=False)

    def _isEmailAlreadyUsed(self, email):
        participantList = []
        if self._kindOfList in ("prAuthor", "coAuthor"):
            participantList = self._contribution.getPrimaryAuthorList() + self._contribution.getCoAuthorList()
        elif self._kindOfList == "speaker":
            participantList = self._contribution.getSpeakerList()

        for part in participantList:
            if email == part.getEmail():
                return True
        return False

    def _getParticipantsList(self, participantList):
        result = []
        for part in participantList:
            partFossil = fossilize(part)
            # var to control if we have to show the entry in the author menu to allow add submission rights
            isSubmitter = False
            av = AvatarHolder().match({"email": part.getEmail()}, forceWithoutExtAuth=True, exact=True)
            if not av:
                if part.getEmail() in self._contribution.getSubmitterEmailList():
                    isSubmitter = True
            elif (av[0] in self._contribution.getSubmitterList() or self._conf.getPendingQueuesMgr().isPendingSubmitter(part)):
                isSubmitter = True
            partFossil["showSubmitterCB"] = not isSubmitter
            result.append(partFossil)
        return result
예제 #52
0
 def _checkParams(self):
     AdminService._checkParams(self)
     pm = ParameterManager(self._params)
     self._userId = pm.extract("userId", pType=str, allowEmpty=False)
     self._av = AvatarHolder().getById(self._userId)
     if self._av == None:
         raise NoReportError(_("The user that you are trying to login as does not exist anymore in the database"))
예제 #53
0
파일: handlers.py 프로젝트: arturodr/indico
class AgentOperationBase(AdminService):
    def _checkParams(self):
        self._pm = ParameterManager(self._params)
        AdminService._checkParams(self)
        self._id = self._pm.extract('id', pType=str)
        self._sm = SyncManager.getDBInstance()
        self._agent = self._sm.getAllAgents()[self._id]
예제 #54
0
 def _checkParams(self):
     AdminService._checkParams(self)
     pm = ParameterManager(self._params)
     user_id = pm.extract("userId", pType=int, allowEmpty=False)
     self._user = User.get(user_id)
     if self._user is None:
         raise NoReportError(_("The user that you are trying to login as does not exist anymore in the database"))
예제 #55
0
파일: services.py 프로젝트: Ictp/indico
    def _checkParams(self):
        CollaborationBase._checkParams(self)

        if 'bookingParams' in self._params:
            pm = ParameterManager(self._params)
            self._bookingParams = pm.extract("bookingParams", pType=dict, allowEmpty = True)
        else:
            raise CollaborationException(_("Custom parameters for plugin ") + str(self._type) + _(" not set when trying to create a booking on meeting ") + str(self._conf.getId() ))