More generic code using @8f4458b
This commit is contained in:
parent
8f4458b009
commit
cd4d8a4c3f
1 changed files with 3 additions and 11 deletions
|
@ -78,17 +78,9 @@ def generate_first_url(user):
|
|||
]
|
||||
)
|
||||
search_term = random.choice(interset)
|
||||
if isinstance(search_term, profiles.Website):
|
||||
if user.uses_url:
|
||||
url = search_term.url
|
||||
elif random.random() <= 0.1:
|
||||
url = random.choice(search_term.notable_pages).url
|
||||
elif random.random() >= 0.3:
|
||||
search_term_text = search_term.name + " " + random.choice(search_term.keywords)
|
||||
url = user.search_engine.search_url(search_term_text)
|
||||
#if
|
||||
#elif isinstance(search_term, profiles.Website):
|
||||
# url = user.search_engine.search_url(search_term)
|
||||
url = search_term.generate_url(user)
|
||||
return url
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue