Improve debug logs
This commit is contained in:
parent
79b4b449d1
commit
57311eda73
1 changed files with 17 additions and 9 deletions
|
@ -671,20 +671,28 @@ class OrdersHostingDetailView(LoginRequiredMixin,
|
||||||
model = HostingOrder
|
model = HostingOrder
|
||||||
|
|
||||||
def get_object(self, queryset=None):
|
def get_object(self, queryset=None):
|
||||||
logger.debug("Within OrdersHostingDetailView get_object")
|
order_id = self.kwargs.get('pk')
|
||||||
try:
|
logger.debug(
|
||||||
hosting_order_obj = HostingOrder.objects.get(
|
"Within OrdersHostingDetailView get_object {order_id}".format(
|
||||||
pk=self.kwargs.get('pk')
|
order_id=order_id
|
||||||
)
|
)
|
||||||
logger.debug("Found HostingOrder obj")
|
)
|
||||||
|
try:
|
||||||
|
hosting_order_obj = HostingOrder.objects.get(pk=order_id)
|
||||||
|
logger.debug("Found HostingOrder for id {order_id}".format(
|
||||||
|
order_id=order_id
|
||||||
|
))
|
||||||
except HostingOrder.DoesNotExist:
|
except HostingOrder.DoesNotExist:
|
||||||
logger.debug("HostingOrder obj not found")
|
logger.debug("HostingOrder not found for id {order_id}".format(
|
||||||
|
order_id=order_id
|
||||||
|
))
|
||||||
hosting_order_obj = None
|
hosting_order_obj = None
|
||||||
if not self.request.user.has_perm(hosting_order_obj):
|
if not self.request.user.has_perm(hosting_order_obj):
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"User {user} has no perm on HostingOrder {order}".format(
|
"User {user} does not have permission on HostingOrder "
|
||||||
user=self.request.email,
|
"{order_id}. Raising 404 error now.".format(
|
||||||
order=hosting_order_obj.id if hosting_order_obj else 'None'
|
user=self.request.user.email,
|
||||||
|
order_id=order_id if hosting_order_obj else 'None'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
Loading…
Reference in a new issue