Skip to content

Commit

Permalink
Exclude default styles from built URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed May 1, 2021
1 parent 7810c84 commit b8344c7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ def build_custom_url(
view_name = f"Memes.text_{extension}"
else:
view_name = f"Memes.text_{settings.DEFAULT_EXT}"
if style == settings.DEFAULT_STYLE:
style = ""
url = request.app.url_for(
view_name,
template_id="custom" if self.id == "_custom" else self.id,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions templates/_test/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ text:
scale_x: 1.0
scale_y: 0.2
styles:
- sample
- default
example:
- your text
- goes here
overlay:
- center_x: 0.5
- center_x: 0.123
center_y: 0.5
scale: 0.25
Empty file removed templates/_test/sample.jpg
Empty file.

0 comments on commit b8344c7

Please sign in to comment.