update
This commit is contained in:
commit
d78643de95
@ -33,8 +33,11 @@ class InjectParamsMiddleware:
|
|||||||
def __init__(self, get_response):
|
def __init__(self, get_response):
|
||||||
self.get_response = get_response
|
self.get_response = get_response
|
||||||
|
|
||||||
def __call__(self, request):
|
def __call__(self, request):
|
||||||
request.entity = request.user.dealer.entity
|
try:
|
||||||
|
request.entity = request.user.dealer.entity
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
response = self.get_response(request)
|
response = self.get_response(request)
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,17 @@
|
|||||||
|
|
||||||
{% block extra_js %}
|
{% block extra_js %}
|
||||||
<script>
|
<script>
|
||||||
|
const Toast = Swal.mixin({
|
||||||
|
toast: true,
|
||||||
|
position: "top-end",
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 2000,
|
||||||
|
timerProgressBar: false,
|
||||||
|
didOpen: (toast) => {
|
||||||
|
toast.onmouseenter = Swal.stopTimer;
|
||||||
|
toast.onmouseleave = Swal.resumeTimer;
|
||||||
|
}
|
||||||
|
});
|
||||||
// Add new form fields
|
// Add new form fields
|
||||||
document.getElementById('addMoreBtn').addEventListener('click', function(e) {
|
document.getElementById('addMoreBtn').addEventListener('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -133,7 +144,7 @@
|
|||||||
} else if (data.status === "success") {
|
} else if (data.status === "success") {
|
||||||
notify("success","Estimate created successfully");
|
notify("success","Estimate created successfully");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = data.url; // Redirect to the provided URL
|
window.location.assign(data.url); // Redirect to the provided URL
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
notify("error","Unexpected response from the server");
|
notify("error","Unexpected response from the server");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user