From cc408ba25404d69efb207534dc245ee22abd280c Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Wed, 6 Nov 2024 02:38:03 +0530 Subject: [PATCH] [BUG] MAC address set to uppercase when creating a registering a new device #922 In device registration view, Made changes to the init object and included checked if attribute is mac_address then it should be changed to upper case Fixes #922 Signed-off-by: chahatsagarmain --- openwisp_controller/config/controller/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openwisp_controller/config/controller/views.py b/openwisp_controller/config/controller/views.py index dfbcc40ec..2e51964ec 100644 --- a/openwisp_controller/config/controller/views.py +++ b/openwisp_controller/config/controller/views.py @@ -287,7 +287,10 @@ def init_object(self, **kwargs): device_model._meta.get_field(attr) except FieldDoesNotExist: continue - options[attr] = kwargs.get(attr) + if attr == 'mac_address': + options[attr] = kwargs.get(attr).upper() + else: + options[attr] = kwargs.get(attr) # do not specify key if: # app_settings.CONSISTENT_REGISTRATION is False # if key is ``None`` (it would cause exception)