Skip to content

Commit

Permalink
fdtester
Browse files Browse the repository at this point in the history
- Catch possible no environ.
  • Loading branch information
JVickery-TBS authored Dec 12, 2024
1 parent aa4a88d commit 9398805
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckanext/api_tracking/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def track_usage(self, data, api_token):
# we can do something with the data after it has been tracked
data = item.before_track_usage(data)

environ = data.pop('environ')
environ = data.pop('environ', None)
if not environ:
log.warning('No environment initialized for request. Unable to track')
return
ckan_url = CKANURL(environ)
method = ckan_url.method.lower()
tracking_type = data['tracking_type']
Expand Down

0 comments on commit 9398805

Please sign in to comment.