Release 0.1.45: member phone locations and people-first family navigation
This commit is contained in:
+8
-1
@@ -185,7 +185,14 @@ class Journal:
|
||||
mode = query.get('mode', 'feed')
|
||||
if mode == 'feed': entries = [e for e in entries if e['visibility'] == 'household']
|
||||
elif mode == 'mine': entries = [e for e in entries if e['ownerId'] == user['id']]
|
||||
elif mode == 'person': entries = [e for e in entries if e['ownerId'] == query.get('person') or query.get('person') in e.get('participantIds', [])]
|
||||
elif mode == 'person':
|
||||
person_id = query.get('person', '')
|
||||
authors = {person_id} if person_id else set()
|
||||
if person_id:
|
||||
authors.update(u['id'] for u in a.objects('users') if u.get('personId') == person_id)
|
||||
# Querying the real person also finds their linked account's earlier notes.
|
||||
# Visibility was checked first: being family or an admin never reveals private notes.
|
||||
entries = [e for e in entries if e['ownerId'] in authors or person_id in e.get('participantIds', [])]
|
||||
for field, compare in [('from', lambda x, y: x >= y), ('to', lambda x, y: x <= y)]:
|
||||
if query.get(field):
|
||||
self.date(query[field]); entries = [e for e in entries if compare(e['occurredOn'], query[field])]
|
||||
|
||||
Reference in New Issue
Block a user