Skip to content

Commit 44f50ee

Browse files
committed
Fix for setup-db.py without do migrations
1 parent 91ff8ad commit 44f50ee

File tree

6 files changed

+7
-766
lines changed

6 files changed

+7
-766
lines changed

REQUIREMENTS

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ path.py
99
psycopg2==2.4.1
1010
pysolr
1111
pycrypto
12-
pil
12+
pillow
1313
docutils
1414
sphinx
1515
django-taggit

deployment/setup_db.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
admin.save()
3131

3232
rusty, rusty_profile = people_config.setup()
33-
rusty_contact, rusty_home_number, rusty_work_number = contact_config.setup()
33+
rusty_contact, rusty_home_number, rusty_work_number = contact_config.setup(userprofile=rusty_profile)
3434

3535
rusty_profile.contact_info = rusty_contact
3636
rusty_profile.save()

what_apps/contact/config.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
from what_apps.contact.models import ContactInfo, PhoneNumber
22

33

4-
def setup():
5-
rusty_contact = ContactInfo.objects.create(
4+
def setup(userprofile=None):
5+
rusty_contact = ContactInfo.objects.create(
66
address="7 somewhere ave.",
77
address_line2="apt. 69",
88
city="New Paltz",
99
state="New York",
1010
postal_code=12561
1111
)
1212

13+
rusty_contact.userprofile = userprofile
14+
rusty_contact.save()
15+
1316
home_number = PhoneNumber.objects.create(number=8455556669,
1417
owner=rusty_contact,
1518
type="home")

0 commit comments

Comments
 (0)