Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
		def condition(lm, etag):
			return check_etag(etag)
Exemplo n.º 3
0
		def condition(lm, etag):
			return check_etag(etag)
Exemplo n.º 4
0
 def condition():
     check = check_etag(etag())
     return check
Exemplo n.º 5
0
		def condition():
			return check_etag(etag())