Permalink
Browse files

Merge pull request #2 from airtonix/patch-1

Avoid missing table errors on initial syncdb or migrate. see : https://g...
  • Loading branch information...
2 parents 3dfad3b + 8089b3a commit b8ea502e15cdd9d5c2ba7a771178341661c2da65 @MegaMark16 committed Dec 29, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 cms_themes/__init__.py
View
8 cms_themes/__init__.py
@@ -32,7 +32,13 @@ def set_themes():
return
site = Site.objects.get(id=settings.SITE_ID)
- themes = [theme.name for theme in site.theme_set.all()]
+ themes = None
+
+ if hasattr(site, 'theme_set'):
+ try:
+ themes = [theme.name for theme in site.theme_set.all()]
+ except:
+ pass
if not themes:
return

0 comments on commit b8ea502

Please sign in to comment.