Gabriel - Iulian Dumbrava  committed 1eaa871

Added setting POSTMAN_SHOW_USERS_AS to return sender's full name if set to "full_name".

  • Participants
  • Parent commits faa48d5
  • Branches default

Comments (0)

Files changed (1)

File postman/

     def obfuscated_sender(self):
-        """Return the sender either as a username or as an undisclosed email."""
+        """
+        Return the sender as an username, as an undisclosed email or full name.
+        If you set POSTMAN_SHOW_USERS_AS = "full_name" then the full name will be returned.
+        """
         if self.sender:
-            return unicode(self.sender)
+            show_users = getattr(settings, 'POSTMAN_SHOW_USERS_AS', None) 
+            if show_users == "full_name":
+                return unicode(self.sender.get_full_name())
+            else:  
+                return unicode(self.sender)
             return self._obfuscated_email()