Remove more unnecesary lowercase on attachments

remotes/origin/enhancement/email-actions
Jesús Espino 2015-06-30 20:34:56 +02:00
parent eeaac88463
commit 12b93b78a1
3 changed files with 3 additions and 3 deletions

View File

@ -276,7 +276,7 @@ def store_attachment(project, obj, attachment):
serialized.object.owner = serialized.object.project.owner serialized.object.owner = serialized.object.project.owner
serialized.object._importing = True serialized.object._importing = True
serialized.object.size = serialized.object.attached_file.size serialized.object.size = serialized.object.attached_file.size
serialized.object.name = path.basename(serialized.object.attached_file.name).lower() serialized.object.name = path.basename(serialized.object.attached_file.name)
serialized.save() serialized.save()
return serialized return serialized
add_errors("attachments", serialized.errors) add_errors("attachments", serialized.errors)

View File

@ -56,7 +56,7 @@ class BaseAttachmentViewSet(HistoryResourceMixin, WatchedResourceMixin, ModelCru
obj.content_type = self.get_content_type() obj.content_type = self.get_content_type()
obj.owner = self.request.user obj.owner = self.request.user
obj.size = obj.attached_file.size obj.size = obj.attached_file.size
obj.name = path.basename(obj.attached_file.name).lower() obj.name = path.basename(obj.attached_file.name)
if obj.project_id != obj.content_object.project_id: if obj.project_id != obj.content_object.project_id:
raise exc.WrongArguments(_("Project ID not matches between object and project")) raise exc.WrongArguments(_("Project ID not matches between object and project"))

View File

@ -221,7 +221,7 @@ class Command(BaseCommand):
membership = self.sd.db_object_from_queryset(obj.project.memberships membership = self.sd.db_object_from_queryset(obj.project.memberships
.filter(user__isnull=False)) .filter(user__isnull=False))
attachment = Attachment.objects.create(project=obj.project, attachment = Attachment.objects.create(project=obj.project,
name=path.basename(attached_file.name).lower(), name=path.basename(attached_file.name),
size=attached_file.size, size=attached_file.size,
content_object=obj, content_object=obj,
order=order, order=order,