MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / group_promote_admin

Function group_promote_admin

Scripts/ButSystem.py:14560–14586  ·  view source on GitHub ↗

group_promote_admin. Admin-only route handler. This docstring was expanded to make future maintenance easier. Args: gid: Parameter. Returns: Varies.

(gid: int)

Source from the content-addressed store, hash-verified

14558"""
14559 u = c["username"].lower()
14560 n = str(c["nickname"]).lower()
14561 # smaller is better
14562 s1 = _user_match_score(q, c["username"])
14563 s2 = 0 if ql in u else 3
14564 s3 = 1 if ql in n else 4
14565 return (s1, s2, s3, len(u), u)
14566 cards.sort(key=score)
14567 cards = [c for c in cards if (ql in c["username"].lower() or ql in str(c["nickname"]).lower())][:12]
14568 else:
14569 cards = cards[:12]
14570
14571 try:
14572 story_users = _story_active_usernames()
14573 except Exception:
14574 story_users = set()
14575 for c in cards:
14576 try:
14577 c["has_story"] = (c.get("username") in story_users)
14578 except Exception:
14579 c["has_story"] = False
14580
14581 return jsonify({"users": cards})
14582
14583@app.route("/api/ping", methods=["POST"])
14584@login_required
14585def api_ping():
14586 """api_ping.
14587
14588Route handler or application helper.
14589

Callers

nothing calls this directly

Calls 3

current_userFunction · 0.70
group_roleFunction · 0.70
db_connectFunction · 0.70

Tested by

no test coverage detected