mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
a066fcc909
* 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
27 lines
595 B
Python
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',
|
|
]
|