Fix path
This commit is contained in:
parent
4b19febdf6
commit
0661fe0f01
1 changed files with 7 additions and 4 deletions
|
@ -6,13 +6,16 @@ the preferred search engin, and if the user is likely to directly use urls
|
||||||
or to type in the search engine.
|
or to type in the search engine.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
import random
|
import random
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
NICKNAMES = open("/usr/share/dict/american-english").read().splitlines()
|
NICKNAMES = open("/usr/share/dict/american-english").read().splitlines()
|
||||||
LASTNAMES = open("../data/lastnames.txt").read().splitlines()
|
LASTNAMES = open(BASE_DIR + "/data/lastnames.txt").read().splitlines()
|
||||||
FIRSTNAMES = open("../data/firstnames.txt").read().splitlines()
|
FIRSTNAMES = open(BASE_DIR + "/data/firstnames.txt").read().splitlines()
|
||||||
EMAIL_DOMAINS = open("../data/email_domains.txt").read().splitlines()
|
EMAIL_DOMAINS = open(BASE_DIR + "/data/email_domains.txt").read().splitlines()
|
||||||
|
|
||||||
|
|
||||||
class InvalidData(Exception):
|
class InvalidData(Exception):
|
||||||
|
@ -223,7 +226,7 @@ def create_profile(nick=None):
|
||||||
nick=nick,
|
nick=nick,
|
||||||
first_name=first_name,
|
first_name=first_name,
|
||||||
last_name=last_name,
|
last_name=last_name,
|
||||||
email=email
|
email=email,
|
||||||
uses_url=(random.random() < 0.5),
|
uses_url=(random.random() < 0.5),
|
||||||
)
|
)
|
||||||
profile.search_engine = random.choice(SearchEngine.objects.all())
|
profile.search_engine = random.choice(SearchEngine.objects.all())
|
||||||
|
|
Loading…
Reference in a new issue