PEP fixes

This commit is contained in:
Oliver 2021-11-28 22:36:47 +11:00
parent 78309c1915
commit 32be39774f
5 changed files with 4 additions and 5 deletions

View File

@ -116,7 +116,7 @@ class InvenTreeAttachment(models.Model):
})
super().save(*args, **kwargs)
def __str__(self):
if self.attachment is not None:
return os.path.basename(self.attachment.name)

View File

@ -289,7 +289,6 @@ class InvenTreeAttachmentSerializer(InvenTreeModelSerializer):
)
class InvenTreeImageSerializerField(serializers.ImageField):
"""
Custom image serializer.

View File

@ -16,7 +16,7 @@ from rest_framework import serializers
from rest_framework.serializers import ValidationError
from InvenTree.serializers import InvenTreeModelSerializer, InvenTreeAttachmentSerializer
from InvenTree.serializers import InvenTreeAttachmentSerializerField, UserSerializerBrief
from InvenTree.serializers import UserSerializerBrief
import InvenTree.helpers
from InvenTree.serializers import InvenTreeDecimalField

View File

@ -24,7 +24,6 @@ from InvenTree.serializers import InvenTreeAttachmentSerializer
from InvenTree.serializers import InvenTreeModelSerializer
from InvenTree.serializers import InvenTreeDecimalField
from InvenTree.serializers import InvenTreeMoneySerializer
from InvenTree.serializers import InvenTreeAttachmentSerializerField
from InvenTree.status_codes import StockStatus
from part.serializers import PartBriefSerializer

View File

@ -149,7 +149,8 @@ function loadAttachmentTable(url, options) {
return renderLink(html, value);
} else if (row.link) {
return renderLink(row.link, row.link);
var html = `<span class='fas fa-link'></span> ${row.link}`;
return renderLink(html, row.link);
} else {
return '-';
}