user to only username

This commit is contained in:
2026-06-12 00:10:57 +03:00
parent 412e5e65c6
commit 37bcfa2ee2
2 changed files with 5 additions and 12 deletions

View File

@@ -55,7 +55,7 @@ async def slack_log_fwd(app, loop):
msg = "%s %s access for %s via %s" % (
approvedStr(ev["approved"]),
ev["door"],
ev["user"]["name"],
ev["user"],
ev["method"],
)
slack_post(msg)
@@ -126,16 +126,14 @@ async def slack_open(request):
"timestamp": datetime.now(timezone.utc),
"door": d,
"approved": True,
"user": {
"id": userOrErrorMsg,
"name": request.form.get("user_name"),
},
"user": userOrErrorMsg,
}
)
if userOrErrorMsg.startswith("🖕"):
slackId = userOrErrorMsg.removeprefix("🖕 ")
print(f"WARN: slack #members open with unlinked ID {slackId}")
slackIdReadable = request.form.get("user_name") # this can be changed by user
print(f"WARN: slack #members open with unlinked ID {slackId}, slack u/n: {slackIdReadable}")
return text(f"Opening {door}… This will stop working! Your Slack ID {slackId} is not linked with auth.k-space.ee, please notify info@k-space.ee.")
return text(f"Opening {door}")