Skip to content

Commit

Permalink
Merge pull request #954 from kartoza/download-action-on-sites
Browse files Browse the repository at this point in the history
prevent subscriptable error
  • Loading branch information
tinashechiraya authored Mar 5, 2024
2 parents e2544a3 + 787f2cb commit e9529de
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions django_project/monitor/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ def download_records(self, request, queryset):
])

for obs in queryset:
if obs['flag'] == 'clean':
flag = 'Verified'
else:
flag = 'Unverified'
try:
user_profile = obs.user.userprofile
user_organization_name = user_profile.organisation_name
Expand Down Expand Up @@ -222,9 +218,9 @@ def download_selected_sites(self, request, queryset):
'Site Location',
'Created By',
'User Organization Name',
'User Is Expert Status'
'User Expert Status'
'User Country',
'Time Stamp'
'Site Created On'
])

for site in queryset:
Expand All @@ -245,9 +241,9 @@ def download_selected_sites(self, request, queryset):
smart_str(site.river_cat),
smart_str(f"Longitude: {site.the_geom.x}, Latitude: {site.the_geom.y}"),
smart_str(site.user.email),
smart_str(user_organization_name),
smart_str(user_country),
smart_str(user_organization_name),
smart_str(user_is_expert),
smart_str(user_country),
smart_str(site.time_stamp)
]
)
Expand Down

0 comments on commit e9529de

Please sign in to comment.