Skip to content

Commit

Permalink
Enable anonymous submissions by default
Browse files Browse the repository at this point in the history
  • Loading branch information
JacquelineMorrissette authored and jnm committed May 9, 2024
1 parent 7ff9da5 commit a26f982
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions equitytool/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,22 @@ def _create_kpi_asset(self):
data = {'active': True}
response = requests.post(deploy_url, data=data, headers=self._headers())
assert response.status_code == 200

# Assign anonymous submissions permissions
permission_assignment_url = '{}api/v2/assets/{}/permission-assignments/'.format(
self.KPI_URL, asset_uid
)
permission_data = {
'user': '{}api/v2/users/AnonymousUser/'.format(self.KPI_URL),
'permission': '{}api/v2/permissions/add_submissions/'.format(self.KPI_URL)
}
permission_response = requests.post(
permission_assignment_url,
data=permission_data,
headers=self._headers()
)
assert permission_response.status_code == 201

return response.json()['asset']

def set_form(self):
Expand Down

0 comments on commit a26f982

Please sign in to comment.