Skip to content

Commit

Permalink
Merge branch 'bhtom2-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Purdenko committed Oct 14, 2024
2 parents 263c77b + 71d2ea6 commit 1626202
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bhtom2/bhtom_common/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,15 @@ def post(self, request, *args, **kwargs):
messages.error(self.request, 'Data is empty!')
return redirect(reverse('bhtom_common:list'))

if 'update-photometry' in request.POST or 'test-reload-photometry' in request.POST:
return HttpResponseRedirect(reverse('bhtom_common:reload_photometry_fits') + f'?data={",".join(data_ids)}')
if 'update-photometry' in request.POST:
action = 'update-photometry'
elif 'test-reload-photometry' in request.POST:
action = 'test-reload-photometry'
else:
action = None

if action:
return HttpResponseRedirect(reverse('bhtom_common:reload_photometry_fits') + f'?action={action}&data={",".join(data_ids)}')

for data_id in data_ids:
try:
Expand Down Expand Up @@ -360,7 +367,8 @@ def get(self, request, *args, **kwargs):
}

try:
if 'test-reload-photometry' in request.POST:
action = self.request.GET.get('action', '')
if action == 'test-reload-photometry':
response = requests.post(settings.UPLOAD_SERVICE_URL + '/testReloadFits/', data=post_data, headers=headers)
else:
response = requests.post(settings.UPLOAD_SERVICE_URL + '/reloadFits/', data=post_data, headers=headers)
Expand Down

0 comments on commit 1626202

Please sign in to comment.