Commit 021150da4be516d083b280fd2959c7756044451f
1 parent
968668f4
Exists in
master
and in
3 other branches
Changin theme image verification
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
themes/models.py
| 1 | +from os import path | |
| 1 | 2 | from django.db import models |
| 2 | 3 | from django.utils.translation import ugettext_lazy as _ |
| 3 | 4 | from django.contrib.staticfiles.templatetags.staticfiles import static |
| ... | ... | @@ -27,7 +28,7 @@ class Themes(models.Model): |
| 27 | 28 | @property |
| 28 | 29 | def favicon_url(self): |
| 29 | 30 | if self.favicon and hasattr(self.favicon, 'url'): |
| 30 | - if self.favicon.url != '/uploads/favicon_amadeus.png': | |
| 31 | + if path.exists(self.favicon.url): | |
| 31 | 32 | return self.favicon.url |
| 32 | 33 | |
| 33 | 34 | return static('img/favicon_amadeus.png') |
| ... | ... | @@ -35,7 +36,7 @@ class Themes(models.Model): |
| 35 | 36 | @property |
| 36 | 37 | def small_logo_url(self): |
| 37 | 38 | if self.small_logo and hasattr(self.small_logo, 'url'): |
| 38 | - if self.small_logo.url != '/uploads/logo_pequena_amadeus.png': | |
| 39 | + if path.exists(self.small_logo.url): | |
| 39 | 40 | return self.small_logo.url |
| 40 | 41 | |
| 41 | 42 | return static('img/logo_pequena_amadeus.png') |
| ... | ... | @@ -43,7 +44,7 @@ class Themes(models.Model): |
| 43 | 44 | @property |
| 44 | 45 | def large_logo_url(self): |
| 45 | 46 | if self.large_logo and hasattr(self.large_logo, 'url'): |
| 46 | - if self.large_logo.url != '/uploads/logo_grande_amadeus.png': | |
| 47 | + if path.exists(self.large_logo.url): | |
| 47 | 48 | return self.large_logo.url |
| 48 | 49 | |
| 49 | 50 | return static('img/logo_grande_amadeus.png') |
| 50 | 51 | \ No newline at end of file | ... | ... |