Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #21 from aldryn/tom/fix-style-validation
Browse files Browse the repository at this point in the history
When validating style, look for the template in the correct place.
  • Loading branch information
Tom Berger committed Mar 31, 2015
2 parents 247b8f4 + 12acad1 commit 9d02419
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aldryn_gallery/forms.py
Expand Up @@ -16,7 +16,11 @@ def clean_style(self):
style = self.cleaned_data.get('style')
# Check if template for style exists:
try:
select_template(['aldryn_gallery/%s/gallery.html' % style])
select_template(
['aldryn_gallery/plugins/{}/gallery.html'.format(style)])
except TemplateDoesNotExist:
raise forms.ValidationError("Not a valid style (Template does not exist)")
raise forms.ValidationError(
"Not a valid style (Template "
"'aldryn_gallery/plugins/{}/gallery.html' "
"does not exist)".format(style))
return style

0 comments on commit 9d02419

Please sign in to comment.