Skip to content

Commit e839ffc

Browse files
committed
Visibility string instead of number
1 parent 55ee3c8 commit e839ffc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/management/commands/index_and_notify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def construct_template_record(self, rtype, record):
479479
'gov_assistance': 'Yes' if record.request_assistance else 'No',
480480
'ns_assistance': 'Yes' if record.ns_request_assistance else 'No',
481481
'dtype_id': record.dtype_id,
482-
'visibility': record.visibility,
482+
'visibility': record.get_visibility_display(),
483483
'other_fields': {
484484
'appeal': record.get_appeal_display(),
485485
'appeal_amount': record.appeal_amount,
@@ -727,7 +727,7 @@ def notify(self, records, rtype, stype, uid=None):
727727
# Handle Visibility for Field Reports
728728
if rtype == RecordType.FIELD_REPORT:
729729
rtype_of_subscr, stype = self.fix_types_for_subs(rtype, stype)
730-
non_ifrc_records = [rec for rec in record_entries if int(rec['visibility']) != 2]
730+
non_ifrc_records = [rec for rec in record_entries if rec['visibility'] != 'IFRC Only']
731731
if non_ifrc_records:
732732
non_ifrc_filters = (Q(subscription__rtype=rtype_of_subscr) &
733733
Q(subscription__stype=stype) &

0 commit comments

Comments
 (0)