diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index bc26f600..72c8de86 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -52,7 +52,7 @@ from ereuse_devicehub.resources.user.exceptions import InsufficientPermission from ereuse_devicehub.resources.user.models import User DEVICES = { - "All": ["All Devices", "All Components"], + "All": ["All Devices"], "Computer": [ "All Computers", "Desktop", @@ -73,55 +73,12 @@ DEVICES = { "Smartphone", "Cellphone", ], - "DataStorage": ["All DataStorage", "HardDrive", "SolidStateDrive"], - "Accessories & Peripherals": [ - "All Peripherals", - "GraphicCard", - "Motherboard", - "NetworkAdapter", - "Processor", - "RamModule", - "SoundCard", - "Battery", - "Keyboard", - "Mouse", - "MemoryCardReader", - ], } COMPUTERS = ['Desktop', 'Laptop', 'Server'] -COMPONENTS = [ - 'GraphicCard', - 'DataStorage', - 'HardDrive', - 'DataStorage', - 'SolidStateDrive', - 'Motherboard', - 'NetworkAdapter', - 'Processor', - 'RamModule', - 'SoundCard', - 'Display', - 'Battery', - 'Camera', -] - MONITORS = ["ComputerMonitor", "Monitor", "TelevisionSet", "Projector"] MOBILE = ["Mobile", "Tablet", "Smartphone", "Cellphone"] -DATASTORAGE = ["HardDrive", "SolidStateDrive"] -PERIPHERALS = [ - "GraphicCard", - "Motherboard", - "NetworkAdapter", - "Processor", - "RamModule", - "SoundCard", - "Battery", - "Keyboard", - "Mouse", - "MemoryCardReader", -] class FilterForm(FlaskForm): @@ -166,9 +123,6 @@ class FilterForm(FlaskForm): if "All Devices" == self.device_type: filter_type = COMPUTERS + ["Monitor"] + MOBILE - elif "All Components" == self.device_type: - filter_type = COMPONENTS - elif "All Computers" == self.device_type: filter_type = COMPUTERS @@ -178,12 +132,6 @@ class FilterForm(FlaskForm): elif "All Mobile" == self.device_type: filter_type = MOBILE - elif "All DataStorage" == self.device_type: - filter_type = DATASTORAGE - - elif "All Peripherals" == self.device_type: - filter_type = PERIPHERALS - if filter_type: self.devices = self.devices.filter(Device.type.in_(filter_type))