Should get the objects and not the Manager

This commit is contained in:
Rémi Oudin 2018-02-26 15:04:26 +01:00
parent 236e40d359
commit 65f777f00f

View file

@ -94,10 +94,10 @@ class Website(models.Model):
if user.uses_urls:
url = self.url
elif rand <= 0.1:
url = random.choice(self.notable_pages).url
url = random.choice(self.notable_pages.all()).url
elif rand <= 0.8:
search_term_text = self.name + " " + \
random.choice(self.keywords)
random.choice(self.keywords.all())
url = user.search_engine.search_url(search_term_text)
else:
url = user.search_engine.search_url(self.name)