Skip to content

Commit

Permalink
Update mailroom_db command to use Location model
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Jan 9, 2025
1 parent 91ca4db commit 22194fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions temba/utils/management/commands/data/mailroom_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
"first_name": "Ed",
"last_name": "McEditor"
},
{
"email": "viewer1@textit.com",
"role": "V",
"first_name": "Veronica",
"last_name": "Views"
},
{
"email": "agent1@textit.com",
"role": "T",
Expand Down
6 changes: 3 additions & 3 deletions temba/utils/management/commands/mailroom_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from temba.contacts.models import Contact, ContactField, ContactGroup, ContactURN
from temba.flows.models import Flow
from temba.globals.models import Global
from temba.locations.models import AdminBoundary
from temba.locations.models import Location
from temba.msgs.models import Label
from temba.orgs.models import Org, OrgRole, User
from temba.templates.models import Template, TemplateTranslation
Expand Down Expand Up @@ -152,7 +152,7 @@ def load_locations(self, path):
# TODO figure out why this is needed
time.sleep(1)

return AdminBoundary.objects.filter(level=0).get()
return Location.objects.filter(level=0).get()

def reset_id_sequences(self, start: int):
with connection.cursor() as cursor:
Expand All @@ -167,7 +167,7 @@ def create_org(self, spec, superuser, country):
name=spec["name"],
timezone=ZoneInfo("America/Los_Angeles"),
flow_languages=spec["languages"],
country=country,
location=country,
created_on=timezone.now(),
created_by=superuser,
modified_by=superuser,
Expand Down
Binary file modified test-data/nigeria.bin
Binary file not shown.

0 comments on commit 22194fb

Please sign in to comment.