def get_profiles_list(self): mods = self.filamentManager.get_profiles_modifications() lm = mods[0]["changed_at"] if len(mods) > 0 else 0 etag = (hashlib.sha1(str(lm))).hexdigest() if check_lastmodified(int(lm)) and check_etag(etag): return make_response("Not Modified", 304) all_profiles = self.filamentManager.get_all_profiles() if all_profiles is not None: response = jsonify(dict(profiles=all_profiles)) response.set_etag(etag) response.headers["Last-Modified"] = http_date(lm) response.headers["Cache-Control"] = "max-age=0" return response else: return make_response("Database error", 500)
def condition(lm, etag): return check_etag(etag)
def condition(): check = check_etag(etag()) return check
def condition(): return check_etag(etag())