Commit 0af227bc authored by Michal Čihař's avatar Michal Čihař

Do not place widget templates in media directory

Issue #605
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent d7582f9b
......@@ -25,6 +25,7 @@ recursive-include examples *
recursive-include locale *.po
recursive-include locale *.mo
include weblate/trans/tests/data/*
include weblate/trans/widget-images/*.png
include weblate/lang/plurals.txt
exclude weblate/settings.py
prune docs/_build
......
......@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django.conf import settings
from django.utils.translation import ugettext as _
from django.template.loader import render_to_string
from PIL import Image, ImageDraw
......@@ -126,8 +125,8 @@ class Widget(object):
Returns widgets filename.
'''
return os.path.join(
settings.MEDIA_ROOT,
'widgets',
os.path.dirname(__file__),
'widget-images',
'%(widget)s-%(color)s.png' % {
'color': self.color,
'widget': self.name,
......@@ -317,8 +316,8 @@ class BadgeWidget(Widget):
else:
mode = 'failing'
return os.path.join(
settings.MEDIA_ROOT,
'widgets',
os.path.dirname(__file__),
'widget-images',
'badge-%s.png' % mode
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment