mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Add a special serializer class for FileField which has a custom to_representation function
- This was solving a very subtle bug which will probably only ever apply to a single installation instance
- Future me will most likely not remember what this was for or how it works
- In any case, there we go
- Ref: http://www.cdrf.co/3.9/rest_framework.fields/Field.html
(cherry picked from commit 7305094854
)
This commit is contained in:
@ -15,6 +15,7 @@ from django.db.models.functions import Coalesce
|
||||
from company.serializers import SupplierPartSerializer
|
||||
from part.serializers import PartBriefSerializer
|
||||
from InvenTree.serializers import UserSerializerBrief, InvenTreeModelSerializer
|
||||
from InvenTree.serializers import InvenTreeAttachmentSerializerField
|
||||
|
||||
|
||||
class LocationBriefSerializer(InvenTreeModelSerializer):
|
||||
@ -232,6 +233,8 @@ class StockItemTestResultSerializer(InvenTreeModelSerializer):
|
||||
|
||||
key = serializers.CharField(read_only=True)
|
||||
|
||||
attachment = InvenTreeAttachmentSerializerField()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
user_detail = kwargs.pop('user_detail', False)
|
||||
|
||||
|
Reference in New Issue
Block a user