diff --git a/tom_observations/templates/tom_observations/partials/observation_list.html b/tom_observations/templates/tom_observations/partials/observation_list.html index 8013053d8..8e8e865c2 100644 --- a/tom_observations/templates/tom_observations/partials/observation_list.html +++ b/tom_observations/templates/tom_observations/partials/observation_list.html @@ -1,9 +1,14 @@
Facility | Created | Status | Scheduled | Saved data | View | |
---|---|---|---|---|---|---|
Facility | Observation ID | Created | Status | Scheduled | Saved data | View |
{{ observation.facility }} | + {% if observation.url %} +{{ observation.observation_id }} | + {% else %} +{{ observation.observation_id }} | + {% endif %}{{ observation.created }} | {{ observation.status }} | {{ observation.scheduled_start }} | diff --git a/tom_observations/views.py b/tom_observations/views.py index 6ea0dcf26..09f7c0d21 100644 --- a/tom_observations/views.py +++ b/tom_observations/views.py @@ -467,9 +467,9 @@ def form_valid(self, form): ) observation_id = form.cleaned_data['observation_id'] messages.success(self.request, f'Successfully associated observation record {observation_id}') - return redirect(reverse( - 'tom_targets:detail', kwargs={'pk': form.cleaned_data['target_id']}) - ) + base_url = reverse('tom_targets:detail', kwargs={'pk': form.cleaned_data['target_id']}) + query_params = urlencode({'tab': 'observations'}) + return redirect(f'{base_url}?{query_params}') class ObservationRecordDetailView(DetailView): diff --git a/tom_targets/templates/tom_targets/target_detail.html b/tom_targets/templates/tom_targets/target_detail.html index 5fdac4eac..23006fece 100644 --- a/tom_targets/templates/tom_targets/target_detail.html +++ b/tom_targets/templates/tom_targets/target_detail.html @@ -7,20 +7,31 @@ {% endblock %} {% block content %}