Skip to content

Commit 3a0cac0

Browse files
authored
Match User method in TeamMember (#11861)
I'm not sure why this doesn't match, but it's confusing to work with in some templates that sometimes list `TeamMember` and other times list `User` instances. Instead, just match these methods so it's always the same. - Refs readthedocs/ext-theme#546
1 parent 2fa9aed commit 3a0cac0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

readthedocs/organizations/models.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,22 @@ def username(self):
401401

402402
return "Unknown"
403403

404-
@property
405-
def full_name(self):
404+
def get_full_name(self):
406405
"""Return member or invite full name."""
407406
if self.is_member:
408407
return self.member.get_full_name()
409408
return ""
410409

410+
@property
411+
def full_name(self):
412+
"""
413+
Alias property for `get_full_name`.
414+
415+
This is deprecated, use `get_full_name` as it matches the underlying
416+
:py:method:`User.get_full_name`.
417+
"""
418+
return self.get_full_name()
419+
411420
@property
412421
def email(self):
413422
"""Return member or invite email address."""

0 commit comments

Comments
 (0)