Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/apps/bandwagon/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/bandwagon/forms.py')
-rw-r--r--apps/bandwagon/forms.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/bandwagon/forms.py b/apps/bandwagon/forms.py
index a3c9340..7ce311a 100644
--- a/apps/bandwagon/forms.py
+++ b/apps/bandwagon/forms.py
@@ -186,12 +186,13 @@ class CollectionForm(ModelForm):
if default_locale:
c.default_locale = default_locale
+ if icon:
+ c.icontype = 'image/png'
+
c.save()
if icon:
- c.icontype = 'image/png'
- dirname = os.path.join(settings.COLLECTIONS_ICON_PATH,
- str(c.id / 1000), )
+ dirname = c.get_img_dir()
destination = os.path.join(dirname, '%d.png' % c.id)
tmp_destination = os.path.join(dirname,
@@ -208,6 +209,7 @@ class CollectionForm(ModelForm):
tasks.resize_icon.delay(tmp_destination, destination)
c.save()
+
return c
class Meta: