Use co-ment user name when co-ment is directly accessed, even if DECORATED_CREATORS is True (i.e. normaly accessed by API).
authorgibus
Tue, 06 Nov 2012 09:25:44 +0100
changeset 472 39f17ac0388c
parent 471 002377f313a8
child 473 cefe588b2a2b
Use co-ment user name when co-ment is directly accessed, even if DECORATED_CREATORS is True (i.e. normaly accessed by API).
src/cm/models_base.py
--- a/src/cm/models_base.py	Tue Oct 23 13:41:07 2012 +0200
+++ b/src/cm/models_base.py	Tue Nov 06 09:25:44 2012 +0100
@@ -59,7 +59,7 @@
     def get_name(self):
         from cm.cm_settings import DECORATED_CREATORS
         
-        if self.user and not DECORATED_CREATORS:
+        if self.user and (not DECORATED_CREATORS or self.name == None):
             return self.user.username
         else:
             return self.name
@@ -67,7 +67,7 @@
     def get_email(self):
         from cm.cm_settings import DECORATED_CREATORS
         
-        if self.user and not DECORATED_CREATORS:
+        if self.user and (not DECORATED_CREATORS or self.email == None):
             return self.user.email
         else:
             return self.email