# HG changeset patch # User raph # Date 1279203029 -7200 # Node ID 3442202aff1ab92148221d53069c859d54bffb9f # Parent 7aec57e4738f682604d4761e6463c1991953fc35 add parameter to display "decorated" creator (used with api calls) diff -r 7aec57e4738f -r 3442202aff1a src/cm/cm_settings.py --- a/src/cm/cm_settings.py Thu Jul 15 16:09:52 2010 +0200 +++ b/src/cm/cm_settings.py Thu Jul 15 16:10:29 2010 +0200 @@ -28,4 +28,7 @@ TRACKING_HTML = get_setting('TRACKING_HTML', '') # Store IP (or not) in activity -STORE_ACTIVITY_IP = get_setting('STORE_ACTIVITY_IP', True) \ No newline at end of file +STORE_ACTIVITY_IP = get_setting('STORE_ACTIVITY_IP', True) + +# Show 'decorated' users in comments (not structural creator id) +DECORATED_CREATORS = get_setting('DECORATED_CREATORS', False) \ No newline at end of file diff -r 7aec57e4738f -r 3442202aff1a src/cm/models_base.py --- a/src/cm/models_base.py Thu Jul 15 16:09:52 2010 +0200 +++ b/src/cm/models_base.py Thu Jul 15 16:10:29 2010 +0200 @@ -57,13 +57,17 @@ abstract = True def get_name(self): - if self.user: + from cm.cm_settings import DECORATED_CREATORS + + if self.user and not DECORATED_CREATORS: return self.user.username else: return self.name def get_email(self): - if self.user: + from cm.cm_settings import DECORATED_CREATORS + + if self.user and not DECORATED_CREATORS: return self.user.email else: return self.email