Fixed motion projector if comment field is None. Fixed #2614.
This commit is contained in:
parent
e49411250a
commit
5a78f1c510
@ -47,13 +47,14 @@ class MotionAccessPermissions(BaseAccessPermissions):
|
|||||||
for the projector. Removes several fields.
|
for the projector. Removes several fields.
|
||||||
"""
|
"""
|
||||||
data = full_data.copy()
|
data = full_data.copy()
|
||||||
for i, field in enumerate(config['motions_comments']):
|
if data.get('comments') is not None:
|
||||||
if not field.get('public'):
|
for i, field in enumerate(config['motions_comments']):
|
||||||
try:
|
if not field.get('public'):
|
||||||
data['comments'][i] = None
|
try:
|
||||||
except IndexError:
|
data['comments'][i] = None
|
||||||
# No data in range. Just do nothing.
|
except IndexError:
|
||||||
pass
|
# No data in range. Just do nothing.
|
||||||
|
pass
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user