def convertResolutionObject(self, rco): #why is this necessary? To make sure they didn't f**k with the constants. ri = dblayer.getResolutionInfo(rco['id']) if 'spanishResolution' in rco: ri['spanishResolution'] = rco['spanishResolution'] if 'englishResolution' in rco: ri['englishResolution'] = rco['englishResolution'] ri['comments'] = rco['comments'] ri['sponsors'] = rco['sponsors'] if 'selectedLanguage' in rco: ri['selectedLanguage'] = rco['selectedLanguage'] return ri
def performAction(UId, ri, actionTuple, param): oldRI = dblayer.getResolutionInfo(ri['resolutionId']) #FIXME # if not oldRI['ownerId'] == UId: # logging.warn("Fuckup with uid of owner: %d %d" % (oldRI['ownerId'], UId)) # return None, "USER_DOESNT_OWN_RESOLUTION" try: actionTuple.actionFunc(ri, param) except: logging.error(traceback.print_exc()) return None, "UNKNOWN_ERROR" return json.dumps({"Error": None, "Success": True}), None
def getWithUser(self): resolutionId = int(self.request.get('id')) lang = int(self.request.get('language')) ri = dblayer.getResolutionInfo(resolutionId) tAndC = dblayer.getTopicAndCommitteeInfo(ri["topic"], ri["committeeId"]) if lang == languages.ENGLISH: res = ri["englishResolution"] topicName = tAndC["topicEnglishName"] committeeSalutationName = tAndC["committeeDisplayNameEnglish"] committeeAbbr = tAndC["committeeAbbreviationEnglish"] elif lang == languages.SPANISH: res = ri["spanishResolution"] topicName = tAndC["topicSpanishName"] committeeSalutationName = tAndC["committeeDisplayNameSpanish"] committeeAbbr = tAndC["committeeAbbreviationSpanish"] document = generate_document(res, lang, topicName, committeeSalutationName, committeeAbbr, ri["index"], tAndC["topic"], isDraft(ri["status"]), ri["sponsors"]) self.response.headers['Content-Type'] = 'application/vnd.oasis.opendocument.text' self.response.headers['Content-Disposition'] = "attachment; filename=res.fodt" self.response.out.write(document)