Skip to content

Commit

Permalink
[BUG] MAC address set to uppercase when creating a registering a new …
Browse files Browse the repository at this point in the history
…device openwisp#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 openwisp#922

Signed-off-by: chahatsagarmain <[email protected]>
  • Loading branch information
chahatsagarmain committed Nov 5, 2024
1 parent 1b1645c commit cc408ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openwisp_controller/config/controller/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cc408ba

Please sign in to comment.