Asset list item: Don't show user.full_name in latest and random assets

This commit is contained in:
Tobias Johansson 2018-10-04 12:30:05 +02:00
parent 6ad12d0098
commit 879bcffc2b
3 changed files with 15 additions and 6 deletions

View File

@ -29,7 +29,6 @@ def latest_nodes(db_filter, projection, limit):
proj = {
'_created': 1,
'_updated': 1,
'user.full_name': 1,
'project._id': 1,
'project.url': 1,
'project.name': 1,
@ -81,7 +80,7 @@ def latest_assets():
def latest_comments():
latest = latest_nodes({'node_type': 'comment',
'properties.status': 'published'},
{'parent': 1,
{'parent': 1, 'user.full_name': 1,
'properties.content': 1, 'node_type': 1,
'properties.status': 1,
'properties.is_reply': 1},

View File

@ -48,9 +48,17 @@ a.card.asset.card-image-fade.pr-0.mx-0.mb-2(
| {{ asset.name | hide_none }}
ul.card-text.list-unstyled.d-flex.text-black-50.mt-auto.mb-0.text-truncate
li.pr-2.font-weight-bold {{ node_type | undertitle | hide_none }}
li.pr-2.text-truncate {{ asset.project.name | hide_none }}
li.pr-2.text-truncate {{ asset.user.full_name | hide_none }}
li.text-truncate {{ asset._created | pretty_date | hide_none }}
| {% if node_type %}
li.pr-2.font-weight-bold {{ node_type | undertitle }}
| {% endif %}
| {% if asset.project.name %}
li.pr-2.text-truncate {{ asset.project.name }}
| {% endif %}
| {% if asset.user.full_name %}
li.pr-2.text-truncate {{ asset.user.full_name }}
| {% endif %}
| {% if asset._created %}
li.text-truncate {{ asset._created | pretty_date }}
| {% endif %}
| {% endmacro %}

View File

@ -145,6 +145,7 @@ class LatestAssetsTest(AbstractPillarTest):
asset = latest_assets[0]
self.assertEquals(str(ok_id), asset['_id'])
self.assertEquals('Just a node name', asset['name'])
self.assertNotIn('user', asset)
class LatestCommentsTest(AbstractPillarTest):
@ -301,3 +302,4 @@ class LatestCommentsTest(AbstractPillarTest):
self.assertEquals(str(ok_id), comment['_id'])
self.assertEquals('Comment', comment['name'])
self.assertEquals('एनिमेशन is animation in Hindi', comment['properties']['content'])
self.assertEquals('คนรักของผัดไทย', comment['user']['full_name'])