We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45b24b6 commit 46acb5fCopy full SHA for 46acb5f
openwisp_controller/config/base/vpn.py
@@ -892,12 +892,12 @@ def _get_common_name(self):
892
"""
893
d = self.config.device
894
end = 63 - len(d.mac_address)
895
- d.name = d.name[:end]
+ name = d.name[:end]
896
unique_slug = shortuuid.ShortUUID().random(length=8)
897
cn_format = app_settings.COMMON_NAME_FORMAT
898
- if cn_format == "{mac_address}-{name}" and d.name == d.mac_address:
+ if cn_format == "{mac_address}-{name}" and name == d.mac_address:
899
cn_format = "{mac_address}"
900
- common_name = cn_format.format(**d.__dict__)[:55]
+ common_name = cn_format.format(**{**d.__dict__, "name": name})[:55]
901
common_name = f"{common_name}-{unique_slug}"
902
return common_name
903
0 commit comments