Skip to content

Commit

Permalink
Merge branch '55-fix-inventory' into 'development'
Browse files Browse the repository at this point in the history
fix: inventory upload cant determin object organization

Closes #55

See merge request nofusscomputing/projects/django_template!24
  • Loading branch information
jon-nfc committed Jun 11, 2024
2 parents 2252c86 + 2eb5031 commit 60a22f5
Show file tree
Hide file tree
Showing 10 changed files with 418 additions and 181 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@

![Docker Pulls](https://img.shields.io/docker/pulls/nofusscomputing/django-template?style=plastic&logo=docker&color=0db7ed)

![Gitlab Code Coverage](https://img.shields.io/gitlab/pipeline-coverage/nofusscomputing%2Fprojects%2Fdjango_template?branch=master&style=plastic&logo=gitlab&label=Test%20Coverage)

2 changes: 1 addition & 1 deletion app/access/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def user_organizations(self) -> list():


# ToDo: Ensure that the group has access to item
def has_organization_permission(self, organization=None) -> bool:
def has_organization_permission(self, organization: int=None) -> bool:

has_permission = False

Expand Down
73 changes: 73 additions & 0 deletions app/api/serializers/itam/inventory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from django.urls import reverse

from itam.models.device import Device
from rest_framework import serializers




class InventorySerializer(serializers.Serializer):
""" Serializer for Inventory Upload """


class DetailsSerializer(serializers.Serializer):

name = serializers.CharField(
help_text = 'Host name',
required = True
)

serial_number = serializers.CharField(
help_text = 'Devices serial number',
required = True
)

uuid = serializers.CharField(
help_text = 'Device system UUID',
required = True
)


class OperatingSystemSerializer(serializers.Serializer):

name = serializers.CharField(
help_text='Name of the operating system installed on the device',
required = True,
)

version_major = serializers.IntegerField(
help_text='Major semver version number of the OS version',
required = True,
)

version = serializers.CharField(
help_text='semver version number of the OS',
required = True
)


class SoftwareSerializer(serializers.Serializer):

name = serializers.CharField(
help_text='Name of the software',
required = True
)

category = serializers.CharField(
help_text='Category of the software',
default = None,
required = False
)

version = serializers.CharField(
default = None,
help_text='semver version number of the software',
required = False
)


details = DetailsSerializer()

os = OperatingSystemSerializer()

software = SoftwareSerializer(many = True)
Loading

0 comments on commit 60a22f5

Please sign in to comment.