import hashlib from pathlib import Path SEED_MODEL_LABELS = ( "core.SiteBranding", "core.PageTitle", "auth.Group", "accounts.User", "staff.OrganizationalUnit", "customers.ContactGroup", "customers.CustomerProfile", "staff.UnitMembership", "staff.StaffProfile", "tickets.TicketCategory", "tickets.SLAConfig", "tickets.TicketTag", "tickets.GroupDispatch", "tickets.Ticket", "tickets.TicketAccessGrant", "tickets.TicketEvent", "messaging.Message", "messaging.MessageRevision", "messaging.MessageMention", "messaging.MessageReadReceipt", "tickets.TicketReadState", "attachments.AttachmentPolicy", "attachments.Attachment", "notifications.SMSTemplate", "notifications.NotificationPolicy", ) EXCLUDED_VOLATILE_MODELS = ( "admin.LogEntry", "sessions.Session", "accounts.OTPChallenge", "accounts.TicketMagicLink", "accounts.MagicLinkAccessLog", "notifications.NotificationJob", ) def sha256_file(path): digest = hashlib.sha256() with Path(path).open("rb") as stream: for chunk in iter(lambda: stream.read(1024 * 1024), b""): digest.update(chunk) return digest.hexdigest()