Skip to content

Commit 8ce0561

Browse files
committed
Do permissions checks on reduced datums to match plot
1 parent 7536e1f commit 8ce0561

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tom_dataproducts/templatetags/dataproduct_extras.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ def get_photometry_data(context, target, target_share=False):
165165
Displays a table of the all photometric points for a target.
166166
"""
167167
photometry = ReducedDatum.objects.filter(data_type='photometry', target=target).order_by('-timestamp')
168+
if not settings.TARGET_PERMISSIONS_ONLY:
169+
photometry = get_objects_for_user(
170+
context["request"].user,
171+
"tom_dataproducts.view_reduceddatum",
172+
klass=photometry,
173+
)
168174

169175
# Possibilities for reduced_datums from ZTF/MARS:
170176
# reduced_datum.value: {'error': 0.0929680392146111, 'filter': 'r', 'magnitude': 18.2364940643311}

0 commit comments

Comments
 (0)