mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
user_activity: Tighten function signatures with generic QuerySet.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
8f80376501
commit
81ab0b3615
@@ -17,7 +17,9 @@ if settings.BILLING_ENABLED:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_user_activity_records(user_profile: UserProfile) -> List[QuerySet]:
|
def get_user_activity_records(
|
||||||
|
user_profile: UserProfile,
|
||||||
|
) -> QuerySet[UserActivity]:
|
||||||
fields = [
|
fields = [
|
||||||
"user_profile__full_name",
|
"user_profile__full_name",
|
||||||
"query",
|
"query",
|
||||||
@@ -34,7 +36,7 @@ def get_user_activity_records(user_profile: UserProfile) -> List[QuerySet]:
|
|||||||
return records
|
return records
|
||||||
|
|
||||||
|
|
||||||
def raw_user_activity_table(records: List[QuerySet]) -> str:
|
def raw_user_activity_table(records: QuerySet[UserActivity]) -> str:
|
||||||
cols = [
|
cols = [
|
||||||
"query",
|
"query",
|
||||||
"client",
|
"client",
|
||||||
@@ -42,7 +44,7 @@ def raw_user_activity_table(records: List[QuerySet]) -> str:
|
|||||||
"last_visit",
|
"last_visit",
|
||||||
]
|
]
|
||||||
|
|
||||||
def row(record: QuerySet) -> List[Any]:
|
def row(record: UserActivity) -> List[Any]:
|
||||||
return [
|
return [
|
||||||
record.query,
|
record.query,
|
||||||
record.client.name,
|
record.client.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user