_threading_local DATABASE default try order Order objects get pk order

1
2
3
4
5
6
7
8
9
_threading_local.DATABASE = 'default'
try:
order = Order.objects.get(pk=order_id)
except Order.DoesNotExist:
_threading_local.DATABASE = 'partner'
try:
order = Order.objects.get(pk=order_id)
except Order.DoesNotExist:
return HttpResponseBadRequest('bad parameters, order not found')