def __getversionforrequest(self, requestid, requesttype): """ Returns the active version of the request id based on type. """ if requesttype == "ministryrequest": return FOIMinistryRequest.getversionforrequest(requestid)[0] else: return FOIRawRequest.getversionforrequest(requestid)[0]
def createrawrequestwatcher(self, data, userid, usergroups): """Creates a watcher for a user with groups passed in for an unopened request. """ version = FOIRawRequest.getversionforrequest(data["requestid"]) if 'watchedbygroup' in data: return FOIRawRequestWatcher.savewatcher(data, version, userid) else: return FOIRawRequestWatcher.savewatcherbygroups( data, version, userid, self.__getwatchablegroups(usergroups))
def createrawrequestcomment(self, data, userid, type=1): version = FOIRawRequest.getversionforrequest(data["requestid"]) return FOIRawRequestComment.savecomment(type, data, version, userid)