update
This commit is contained in:
parent
3917585e61
commit
8b0cf49d6b
@ -46,3 +46,19 @@ application = ProtocolTypeRouter(
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
from django.conf import settings
|
||||
from django.contrib.sites.models import Site
|
||||
|
||||
if not settings.DEBUG:
|
||||
site = Site.objects.get(id=settings.SITE_ID)
|
||||
if site.domain != settings.PRODUCTION_DOMAIN:
|
||||
site.domain = settings.PRODUCTION_DOMAIN
|
||||
site.name = settings.SITE_NAME
|
||||
site.save()
|
||||
except Exception as e:
|
||||
# Log error but don't crash the app
|
||||
if settings.DEBUG:
|
||||
print(f"Site configuration error in WSGI: {e}")
|
||||
@ -1001,15 +1001,25 @@ def car_created_notification(sender, instance, created, **kwargs):
|
||||
if created:
|
||||
accountants = (
|
||||
models.CustomGroup.objects.filter(
|
||||
dealer=instance.dealer, name__in=["Manager", "Accountant"]
|
||||
dealer=instance.dealer, name__in=["Accountant"]
|
||||
)
|
||||
.first()
|
||||
.group.user_set.all()
|
||||
.distinct()
|
||||
)
|
||||
for accountant in accountants:
|
||||
managers = (
|
||||
models.CustomGroup.objects.filter(
|
||||
dealer=instance.dealer, name__in=["Manager"]
|
||||
)
|
||||
.first()
|
||||
.group.user_set.all()
|
||||
.distinct()
|
||||
)
|
||||
|
||||
recipients = accountants.union(managers)
|
||||
for recipient in recipients:
|
||||
models.Notification.objects.create(
|
||||
user=accountant,
|
||||
user=recipient,
|
||||
message=_(
|
||||
"""
|
||||
New Car {car_make}-{car_model}-{year}-{vin} has been added to the inventory.
|
||||
|
||||
@ -372,11 +372,7 @@
|
||||
hideLoading();
|
||||
const data = await response.json();
|
||||
if (response.ok) {
|
||||
<<<<<<< HEAD
|
||||
notify("success","{% trans 'Account created successfully'%}");
|
||||
=======
|
||||
notify("success","Account created successfully");
|
||||
>>>>>>> d3dcb85fa378e156b77550e8ab833ad10ffad51f
|
||||
setTimeout(() => {
|
||||
window.location.href = "{% url 'account_login' %}";
|
||||
}, 1000);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
<div class="mt-4">
|
||||
<h1>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user