Skip to content

Commit

Permalink
fixing issue #42 on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophia-15 committed Jun 10, 2024
1 parent 7e00638 commit 547ba54
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app_company/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
from datetime import datetime

from django.views import View
Expand Down Expand Up @@ -409,7 +410,7 @@ def post(self, request, pk):
@method_decorator(has_permission_decorator('os&request_ops'), name='dispatch')
class ServiceOrderDetailView(View):
def get(self, request, pk):
previous_url = request.META.get('HTTP_REFERER', '/')
previous_url = request.META.get('HTTP_REFERER', '/') if os.environ['TARGET_ENV'] == 'Dev' else request.META.get('HTTP_REFERER', '/').replace("http", "https")
current_url = request.build_absolute_uri()
employees = Users.objects.filter(role='F')
all_orders = OrderRequest.objects.all()
Expand All @@ -423,9 +424,7 @@ def get(self, request, pk):
ctx = {
"all_orders": all_orders,
"employees": employees,
"previous_url": request.session['previous_url'] ,
"debug_current_url": current_url,
"debug_previous_url": previous_url
"previous_url": request.session['previous_url']
}

try:
Expand Down

0 comments on commit 547ba54

Please sign in to comment.