From 4545bfcd1cf5222e17ddf692138b13c426c52e71 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 10 Nov 2019 17:22:41 -0500 Subject: [PATCH] Return number of updated blogs from annotate --- gitsrht/blueprints/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitsrht/blueprints/api.py b/gitsrht/blueprints/api.py index fb7d887..88bb506 100644 --- a/gitsrht/blueprints/api.py +++ b/gitsrht/blueprints/api.py @@ -159,6 +159,7 @@ def repo_annotate_PUT(username, reponame): valid = Validation(request) + nblobs = 0 for oid, annotations in valid.source.items(): valid.expect(isinstance(oid, str), "blob keys must be strings") valid.expect(isinstance(annotations, list), @@ -173,8 +174,9 @@ def repo_annotate_PUT(username, reponame): json.dumps(annotations)) # Invalidate rendered markup cache redis.delete(f"git.sr.ht:git:highlight:{oid}") + nblobs += 1 - return { }, 200 + return { "updated": nblobs }, 200 @data.route("/api/repos//blob/", defaults={"username": None, "path": ""}) -- 2.38.4