Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

User stats API returns joined-on date

blueheron7860da1f50dbbf2
diff --git a/mwmbl/platform/api.py b/mwmbl/platform/api.py
index 3b1c6ca..0e36126 100644
--- a/mwmbl/platform/api.py
+++ b/mwmbl/platform/api.py
@@ -1116,7 +1116,7 @@ def delete_api_key(request, key_id: int):
auth=JWTAuth(),
response=UserProfileResponse,
summary="Get current user profile",
- description="Returns the authenticated user's username, email, plan, and email confirmation status.",
+ description="Returns the authenticated user's username, email, plan, email confirmation status, and join date.",
tags=["Users"],
)
def get_current_user(request):
@@ -1130,6 +1130,7 @@ def get_current_user(request):
email=user.email,
plan="free" if spend_cents == 0 else "pay-as-you-go",
email_confirmed=email_address.verified if email_address else False,
+ date_joined=user.date_joined,
)
diff --git a/mwmbl/platform/schemas.py b/mwmbl/platform/schemas.py
index a5ce602..9293f79 100644
--- a/mwmbl/platform/schemas.py
+++ b/mwmbl/platform/schemas.py
@@ -12,6 +12,7 @@ class UserProfileResponse(Schema):
email: str
plan: str
email_confirmed: bool
+ date_joined: datetime
class UserStatsResponse(Schema):