estelam ticket, varizha , others

This commit is contained in:
javad committed 2026-10-13 15:48:24 +03:30
1 parent 35a1ec1794
commit 6b546aad76
71 files changed
+2865 -191

No files matched your search

+1 -1
View File
@@ -64,7 +64,7 @@ def staff_operations_access(request):
"create_ticket": user.has_perm("tickets.add_ticket") or allowed("tickets.add_ticket"),
"contacts": True,
"contact_groups": allowed("customers.view_contactgroup") or allowed("customers.add_contactgroup"),
"dispatches": allowed("tickets.create_bulk_dispatch") or allowed("tickets.create_inquiry") or allowed("tickets.dispatch_group_tickets"),
"dispatches": any(allowed(permission) for permission in ("tickets.create_bulk_dispatch", "tickets.create_inquiry", "tickets.dispatch_group_tickets", "tickets.view_all_bulk_dispatches", "tickets.view_all_inquiries")),
"templates": allowed("notifications.view_smstemplate") or allowed("notifications.add_smstemplate"),
"audit": user.has_perm("accounts.view_all_magic_links") or allowed("accounts.view_ticketmagiclink"),
}}
@@ -16,6 +16,14 @@ from apps.core.production_seed import sha256_file
from apps.tickets.models import Ticket
def _load_seed_data(bundle_dir):
# Only the pristine-target guard in handle authorizes this replacement.
call_command("flush", interactive=False, verbosity=0)
call_command("loaddata", str(bundle_dir / "data.json.gz"), verbosity=1)
from apps.notifications.dispatch_opening import ensure_opening_template
ensure_opening_template()
class Command(BaseCommand):
help = "Import a verified production seed bundle into a pristine PostgreSQL database."
@@ -80,10 +88,7 @@ class Command(BaseCommand):
copied_files = []
try:
with transaction.atomic():
# Migrations contain defaults. Flush those rows before loading
# the authoritative SQLite snapshot; schema/migration history remains.
call_command("flush", interactive=False, verbosity=0)
call_command("loaddata", str(bundle_dir / "data.json.gz"), verbosity=1)
_load_seed_data(bundle_dir)
# Old SQLite snapshots may predate unit-scoped queues. A
# category already belongs to exactly one unit, so it is a
# deterministic and safe source for repairing those rows.
+1
View File
@@ -16,6 +16,7 @@ SEED_MODEL_LABELS = (
"tickets.SLAConfig",
"tickets.TicketTag",
"tickets.GroupDispatch",
"tickets.DispatchResponseControl",
"tickets.Ticket",
"tickets.TicketAccessGrant",
"tickets.TicketEvent",
+8
View File
@@ -46,6 +46,14 @@ def jalali_date(value):
return _persian_digits(converted.strftime("%d %B %Y")) if converted else ""
@register.filter
def jalali_datetime_precise(value):
converted = _jalali(value)
if not isinstance(converted, jdatetime.datetime):
return ""
return _persian_digits(converted.strftime("%d %B %Y، ساعت %H:%M:%S"))
@register.filter
def persian_time(value):
"""Display local Iran time using Persian digits."""