seed script
This commit is contained in:
1 parent
fa9d154db9
commit
08c30aa47f
15 files changed
+496
-17
No files matched your search
@@ -0,0 +1,48 @@
|
||||
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()
|
||||
Reference in new issue
Block a user