Skip to content

Commit 0aa480c

Browse files
committed
Remove role badge api endpoint
1 parent 840cd9a commit 0aa480c

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

blueprints/api.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def search_user():
9696
'displayname': u.user.display_name,
9797
'tr_count': u.translation_count,
9898
'cr_count': u.correction_count,
99+
'tr_role_html': role_badge(u.points),
99100
'points': u.points} for u in user]
100101
return result_ok(results)
101102

@@ -179,15 +180,4 @@ def remove_correction(aid: int):
179180
article.corrector = None
180181
article.save()
181182
flash('Korekce odstraněna')
182-
return result_ok()
183-
184-
@ApiController.route('/api/roles/badge', methods=['GET'])
185-
def get_role_badge():
186-
try:
187-
points = request.args.get("points", type=float)
188-
except ValueError:
189-
return result_error("Invalid request (points value not a float)")
190-
if not points:
191-
return result_error("Invalid request (points value not specified)")
192-
role_type = request.args.get("type", default="translator")
193-
return result_ok(role_badge(points, role_type))
183+
return result_ok()

0 commit comments

Comments
 (0)