Skip to content

Commit

Permalink
Better/safer theme-name acquisition
Browse files Browse the repository at this point in the history
  • Loading branch information
growlf committed Jun 30, 2012
1 parent c868da3 commit 5d3a3e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cms_themes/models.py
Expand Up @@ -17,7 +17,7 @@ class Theme(models.Model):
def save(self, *args, **kwargs):
if not self.id:
f = tarfile.open(fileobj=self.theme_file, mode='r:gz')
self.name = f.getnames()[-1]
self.name = os.path.commonprefix(f.getnames())
f.extractall(settings.THEMES_DIR)

super(Theme, self).save(*args, **kwargs)
Expand Down

0 comments on commit 5d3a3e7

Please sign in to comment.