Mercurial > public > sg101
diff gpp/bio/models.py @ 128:48621ba5c385
Fixing #36, Smilify doesn't work when a smiley appears first before other text. Refactored the smiley system to produce markdown as well as HTML.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 20 Nov 2009 01:43:32 +0000 |
parents | 9c18250972d5 |
children | 7ea842744a57 |
line wrap: on
line diff
--- a/gpp/bio/models.py Mon Nov 16 01:00:28 2009 +0000 +++ b/gpp/bio/models.py Fri Nov 20 01:43:32 2009 +0000 @@ -10,8 +10,7 @@ from django.conf import settings from django.core.cache import cache -from core.markup import Markdown -from smiley import Smilify +from core.markup import SiteMarkup def avatar_file_path_for_user(username, filename): @@ -48,9 +47,8 @@ ordering = ('user__username', ) def save(self, *args, **kwargs): - md = Markdown() - sm = Smilify() - self.profile_html = sm.convert(md.convert(self.profile_text)) - self.signature_html = sm.convert(md.convert(self.signature)) + sm = SiteMarkup() + self.profile_html = sm.convert(self.profile_text) + self.signature_html = sm.convert(self.signature) super(UserProfile, self).save(*args, **kwargs) cache.delete('avatar_' + self.user.username)