Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
paulorosadodev committed Jun 10, 2024
2 parents fbc128d + bd7947a commit f360d63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app_company/templates/app_company/service-order.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<i data-lucide="x" class="close" id="closeIcon"></i>
</a>

<h1> {{ debug_current_url }} </h1>
<h1> {{ debug_previous_url }} </h1>

<div class="infos">
<h1>Solicitação {{service_order.id}}</h1>
<p class="{{service_order.status}} status">Status: {{ service_order.get_status_display }}</p>
Expand Down
5 changes: 3 additions & 2 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 @@ -416,7 +417,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 @@ -430,7 +431,7 @@ def get(self, request, pk):
ctx = {
"all_orders": all_orders,
"employees": employees,
"previous_url": request.session['previous_url']
"previous_url": request.session['previous_url']
}

try:
Expand Down

0 comments on commit f360d63

Please sign in to comment.