From: Michael Tremer Date: Fri, 18 Jul 2025 14:58:19 +0000 (+0000) Subject: users: Return the avatar URL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=107b25bfd40cb3432871dfefbf87900c2d475a82;p=pbs.git users: Return the avatar URL Signed-off-by: Michael Tremer --- diff --git a/frontend/src/api/users.ts b/frontend/src/api/users.ts index bcfda7b2..a1e7b8c7 100644 --- a/frontend/src/api/users.ts +++ b/frontend/src/api/users.ts @@ -6,6 +6,9 @@ export interface User { // Realname realname?: string; + + // Avatar URL + avatar_url: string, } /* diff --git a/src/buildservice/users.py b/src/buildservice/users.py index 2ec6124b..32fc3889 100644 --- a/src/buildservice/users.py +++ b/src/buildservice/users.py @@ -603,11 +603,13 @@ class User(sqlmodel.SQLModel, database.BackendMixin, database.SoftDeleteMixin, t # Avatar - def avatar(self, size=512): + @pydantic.computed_field + @property + def avatar_url(self) -> str: """ Returns a URL to the avatar the user has uploaded """ - return "https://people.ipfire.org/users/%s.jpg?size=%s" % (self.name, size) + return "https://people.ipfire.org/users/%s.jpg" % self.name # Permissions