File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
openwisp_controller/config/base Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -892,12 +892,13 @@ def _get_common_name(self):
892892 """
893893 d = self .config .device
894894 end = 63 - len (d .mac_address )
895- d . name = d .name [:end ]
895+ name = d .name [:end ]
896896 unique_slug = shortuuid .ShortUUID ().random (length = 8 )
897897 cn_format = app_settings .COMMON_NAME_FORMAT
898- if cn_format == "{mac_address}-{name}" and d . name == d .mac_address :
898+ if cn_format == "{mac_address}-{name}" and name == d .mac_address :
899899 cn_format = "{mac_address}"
900- common_name = cn_format .format (** d .__dict__ )[:55 ]
900+ data = {** d .__dict__ , "name" : name }
901+ common_name = cn_format .format (** data )[:55 ]
901902 common_name = f"{ common_name } -{ unique_slug } "
902903 return common_name
903904
You can’t perform that action at this time.
0 commit comments