If I hired someone that wrote code like this, I would fire them.

master
Nick Sergeant 2013-01-17 01:33:15 -05:00
parent 44679a7892
commit d8bbb4c3c2
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ class Snipt(models.Model):
def get_full_absolute_url(self):
if self.blog_post:
if self.user.profile.is_pro and self.user.profile.blog_domain is not None:
if self.user.profile.is_pro and self.user.profile.blog_domain is not None and self.user.profile.blog_domain != '':
return 'http://{}/{}/'.format(self.user.profile.blog_domain, self.slug)
else:
return 'https://{}.snipt.net/{}/'.format(self.user.username, self.slug)