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 | from django.db import models | 2 | from django.db import models |
| 2 | from django.utils.translation import ugettext_lazy as _ | 3 | from django.utils.translation import ugettext_lazy as _ |
| 3 | from django.contrib.staticfiles.templatetags.staticfiles import static | 4 | from django.contrib.staticfiles.templatetags.staticfiles import static |
| @@ -27,7 +28,7 @@ class Themes(models.Model): | @@ -27,7 +28,7 @@ class Themes(models.Model): | ||
| 27 | @property | 28 | @property |
| 28 | def favicon_url(self): | 29 | def favicon_url(self): |
| 29 | if self.favicon and hasattr(self.favicon, 'url'): | 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 | return self.favicon.url | 32 | return self.favicon.url |
| 32 | 33 | ||
| 33 | return static('img/favicon_amadeus.png') | 34 | return static('img/favicon_amadeus.png') |
| @@ -35,7 +36,7 @@ class Themes(models.Model): | @@ -35,7 +36,7 @@ class Themes(models.Model): | ||
| 35 | @property | 36 | @property |
| 36 | def small_logo_url(self): | 37 | def small_logo_url(self): |
| 37 | if self.small_logo and hasattr(self.small_logo, 'url'): | 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 | return self.small_logo.url | 40 | return self.small_logo.url |
| 40 | 41 | ||
| 41 | return static('img/logo_pequena_amadeus.png') | 42 | return static('img/logo_pequena_amadeus.png') |
| @@ -43,7 +44,7 @@ class Themes(models.Model): | @@ -43,7 +44,7 @@ class Themes(models.Model): | ||
| 43 | @property | 44 | @property |
| 44 | def large_logo_url(self): | 45 | def large_logo_url(self): |
| 45 | if self.large_logo and hasattr(self.large_logo, 'url'): | 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 | return self.large_logo.url | 48 | return self.large_logo.url |
| 48 | 49 | ||
| 49 | return static('img/logo_grande_amadeus.png') | 50 | return static('img/logo_grande_amadeus.png') |
| 50 | \ No newline at end of file | 51 | \ No newline at end of file |