def handle(request): try: myself = siteaction.getLoggedInUser(request) if not myself: return ajaxian.getFailureResp('not_logged_in') msg_id = dataplus.dictGetVal(request.REQUEST,'messageId') result, msg = mailman.deleteMessage(myself.account, msg_id) if not result: ajaxian.getFailureResp(msg) else: return ajaxian.getSuccessResp(msg) except: return ajaxian.getFailureResp('unknown')
def deleteMessages(request, tom): for key, val in request.POST.iteritems(): if key.find('chkMsg_') == 0: msg_id = string.atoi(key[7:]) mailman.deleteMessage(tom.account, msg_id)