Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/genlab_bestilling/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@
"rerun_date",
),
"Terrestrisk": (
"name",
"genlab_id",
"guid",
"name",
"type.name",
"species.name",
"location.name",
Expand Down
7 changes: 3 additions & 4 deletions src/genlab_bestilling/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ def get_serializer_class(self) -> type[BaseSerializer]:

def get_order_id(self, queryset: QuerySet) -> str:
order_id = "unknown_order_id"
first_sample = queryset.first()
if first_sample and first_sample.order and first_sample.order.id:
order_id = str(first_sample.order.id)

order_id_value = queryset.values_list("order__id", flat=True).first()
if order_id_value:
order_id = str(order_id_value)
return order_id

@action(
Expand Down