InvenTree/InvenTree/users/serializers.py
Oliver a066fcc909
Add new global setting to control auto-upload of test reports (#3137)
* Add new global setting to control auto-upload of test reports

* Adds callback to attach a copy of the test report when printing

* Fix for all attachment API endpoints

- The AttachmentMixin must come first!
- User was not being set, as the custom 'perform_create' function was never called

* Remove duplicated UserSerializer

* display uploading user in attachment table

* Add unit test to check the test report is automatically uploaded
2022-06-06 15:20:41 +10:00

27 lines
595 B
Python

"""DRF API serializers for the 'users' app"""
from rest_framework import serializers
from InvenTree.serializers import InvenTreeModelSerializer
from .models import Owner
class OwnerSerializer(InvenTreeModelSerializer):
"""Serializer for an "Owner" (either a "user" or a "group")"""
name = serializers.CharField(read_only=True)
label = serializers.CharField(read_only=True)
class Meta:
"""Metaclass defines serializer fields."""
model = Owner
fields = [
'pk',
'owner_id',
'name',
'label',
]