From c403ccca3b7210db97801dec38bf4c33255e72d4 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Fri, 29 Nov 2024 09:46:02 +0100 Subject: [PATCH] Apply suggestions from code review Adding minor, but useful suggestions from code review Co-authored-by: Johanna England --- python/nav/django/templatetags/maintenance.py | 2 +- python/nav/models/manage.py | 4 ++-- python/nav/web/maintenance/utils.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/nav/django/templatetags/maintenance.py b/python/nav/django/templatetags/maintenance.py index 799b1d0e5f..e30a89e4ad 100644 --- a/python/nav/django/templatetags/maintenance.py +++ b/python/nav/django/templatetags/maintenance.py @@ -28,7 +28,7 @@ def model_verbose_name(model): return name = model._meta.verbose_name # Keep original capitalization, if any, otherwise apply our own - # e.g. don't turn "IP device" into "Ip device", but do turn "room" into "Room" + # e.g. don't turn "IP Device" into "Ip device", but do turn "room" into "Room" return name if name[0].isupper() else name.capitalize() diff --git a/python/nav/models/manage.py b/python/nav/models/manage.py index de0d240f93..4d2a4ac597 100644 --- a/python/nav/models/manage.py +++ b/python/nav/models/manage.py @@ -282,8 +282,8 @@ class Netbox(models.Model): class Meta(object): db_table = 'netbox' - verbose_name = 'IP device' - verbose_name_plural = 'IP devices' + verbose_name = 'IP Device' + verbose_name_plural = 'IP Devices' ordering = ('sysname',) def __str__(self): diff --git a/python/nav/web/maintenance/utils.py b/python/nav/web/maintenance/utils.py index 19903234e9..4f275158cc 100644 --- a/python/nav/web/maintenance/utils.py +++ b/python/nav/web/maintenance/utils.py @@ -197,7 +197,7 @@ def get_components_from_keydict( component_data_errors.append(f"{key}: invalid component type") continue - objects = model_class.objects.filter(id__in=component_keys[key]) + objects = model_class.objects.filter(id__in=values) components.extend(objects) if not objects: component_data_errors.append(