Commit fcfbfb3a authored by Skia's avatar Skia
Browse files

Small file fix

parent cb90ab8e
Pipeline #158 failed with stage
in 1 minute and 47 seconds
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='sithfile',
name='name',
field=models.CharField(verbose_name='file name', max_length=256),
),
]
...@@ -446,7 +446,7 @@ def get_directory(instance, filename): ...@@ -446,7 +446,7 @@ def get_directory(instance, filename):
return './{0}/{1}'.format(instance.get_parent_path(), filename) return './{0}/{1}'.format(instance.get_parent_path(), filename)
class SithFile(models.Model): class SithFile(models.Model):
name = models.CharField(_('file name'), max_length=30, blank=False) name = models.CharField(_('file name'), max_length=256, blank=False)
parent = models.ForeignKey('self', related_name="children", verbose_name=_("parent"), null=True, blank=True) parent = models.ForeignKey('self', related_name="children", verbose_name=_("parent"), null=True, blank=True)
file = models.FileField(upload_to=get_directory, verbose_name=_("file"), null=True, blank=True) file = models.FileField(upload_to=get_directory, verbose_name=_("file"), null=True, blank=True)
owner = models.ForeignKey(User, related_name="owned_files", verbose_name=_("owner")) owner = models.ForeignKey(User, related_name="owned_files", verbose_name=_("owner"))
......
...@@ -58,8 +58,7 @@ class AddFilesForm(forms.Form): ...@@ -58,8 +58,7 @@ class AddFilesForm(forms.Form):
new_file.clean() new_file.clean()
new_file.save() new_file.save()
except Exception as e: except Exception as e:
self.add_error(None, _("Error uploading file %(file_name)s: %(msg)s") % self.add_error(None, _("Error uploading file %(file_name)s: %(msg)s") % {'file_name': f, 'msg': repr(e)})
{'file_name': f, 'msg': str(e.message)})
class FileListView(ListView): class FileListView(ListView):
template_name = 'core/file_list.jinja' template_name = 'core/file_list.jinja'
......
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