Start of unification of comment and activity streams.

This commit is contained in:
2016-11-02 15:41:07 +01:00
parent 2afb41d00f
commit 733d213ea4
6 changed files with 69 additions and 9 deletions

View File

@@ -48,14 +48,19 @@ def activity_after_replacing_shot(shot, original):
human_key = human_readable_properties[key]
except KeyError:
human_key = pillar.web.jinja.format_undertitle(key.rsplit('.', 1)[-1])
descr = None
if key == 'properties.status':
# Some key- and value-specific overrides
if val_shot is pillar.api.utils.DoesNotExist:
descr = 'removed "%s" from shot "%s"' % (human_key, shot['name'])
elif key == 'properties.status':
val_shot = pillar.web.jinja.format_undertitle(val_shot)
elif isinstance(val_shot, basestring) and len(val_shot) > 80:
val_shot = val_shot[:80] + u''
descr = 'changed "%s" to "%s" in shot "%s"' %\
(human_key, val_shot, shot['name'])
if descr is None:
descr = 'changed "%s" to "%s" in shot "%s"' %\
(human_key, val_shot, shot['name'])
else:
descr = 'edited shot "%s"' % shot['name']