Vorbereitung erstes Release
This commit is contained in:
1 parent
481ccca5da
commit
dfad658237
3 files changed
+6
-6
No files matched your search
@@ -164,9 +164,9 @@ def names_for_form(db: Session, form: Form) -> dict[int, dict[str, SlotNames]]:
|
|||||||
else f"{parts['first']} {parts['last']}".strip()
|
else f"{parts['first']} {parts['last']}".strip()
|
||||||
)
|
)
|
||||||
user_ids = {r.user_id for r in rows if r.user_id is not None and r.response_id not in given}
|
user_ids = {r.user_id for r in rows if r.user_id is not None and r.response_id not in given}
|
||||||
accounts = dict(db.execute(
|
accounts = {uid: name for uid, name in db.execute(
|
||||||
select(UserAccount.id, UserAccount.display_name).where(UserAccount.id.in_(user_ids))
|
select(UserAccount.id, UserAccount.display_name).where(UserAccount.id.in_(user_ids))
|
||||||
).tuples().all()) if user_ids else {}
|
)} if user_ids else {}
|
||||||
guest = gettext("Guest")
|
guest = gettext("Guest")
|
||||||
result: dict[int, dict[str, SlotNames]] = {}
|
result: dict[int, dict[str, SlotNames]] = {}
|
||||||
for row in rows:
|
for row in rows:
|
||||||
|
|||||||
@@ -133,9 +133,9 @@ def participant_names(db: Session, rows: Sequence[Response]) -> dict[int, str]:
|
|||||||
user_ids = {r.user_id for r in rows if r.user_id is not None}
|
user_ids = {r.user_id for r in rows if r.user_id is not None}
|
||||||
if not user_ids:
|
if not user_ids:
|
||||||
return {}
|
return {}
|
||||||
names = dict(db.execute(
|
names = {uid: name for uid, name in db.execute(
|
||||||
select(UserAccount.id, UserAccount.display_name).where(UserAccount.id.in_(user_ids))
|
select(UserAccount.id, UserAccount.display_name).where(UserAccount.id.in_(user_ids))
|
||||||
).tuples().all())
|
)}
|
||||||
return {r.id: names[r.user_id] for r in rows if r.user_id in names}
|
return {r.id: names[r.user_id] for r in rows if r.user_id in names}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -464,12 +464,12 @@ def audit_log(
|
|||||||
found = db.execute(
|
found = db.execute(
|
||||||
select(UserAccount.id, UserAccount.display_name).where(UserAccount.id.in_(user_ids))
|
select(UserAccount.id, UserAccount.display_name).where(UserAccount.id.in_(user_ids))
|
||||||
)
|
)
|
||||||
targets.update({f"user:{i}": name for i, name in found.tuples()})
|
targets.update({f"user:{i}": name for i, name in found})
|
||||||
if group_ids:
|
if group_ids:
|
||||||
found_groups = db.execute(
|
found_groups = db.execute(
|
||||||
select(UserGroup.id, UserGroup.name).where(UserGroup.id.in_(group_ids))
|
select(UserGroup.id, UserGroup.name).where(UserGroup.id.in_(group_ids))
|
||||||
)
|
)
|
||||||
targets.update({f"group:{i}": name for i, name in found_groups.tuples()})
|
targets.update({f"group:{i}": name for i, name in found_groups})
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"admin_audit.html",
|
"admin_audit.html",
|
||||||
|
|||||||
Reference in new issue
Block a user