Commits

Mikhail Lukyanchenko  committed 83e0541

got rid of direct filesystem access for theme discovery (bad idea when you use something like S3)

  • Participants
  • Parent commits a7593d3

Comments (0)

Files changed (2)

File djangobb_forum/models.py

 except ImportError:
     pass
 
-path = os.path.join(settings.MEDIA_ROOT, 'forum', 'themes')
-THEME_CHOICES = [(theme, theme) for theme in os.listdir(path) 
-                 if os.path.isdir(os.path.join(path, theme))]
+THEME_CHOICES = [(theme, theme) for theme in forum_settings.THEMES]
 
 class Category(models.Model):
     name = models.CharField(_('Name'), max_length=80)

File djangobb_forum/settings.py

           (r':rolleyes:', EMOTION_ROLL),
           (r':cool:', EMOTION_COOL)
          )
-SMILES = get('DJANGOBB_SMILES', SMILES)
+SMILES = get('DJANGOBB_SMILES', SMILES)
+
+THEMES = get('DJANGOBB_THEMES', ('default',))