From 7183174f4c6431503823e246c2ebbada458185e3 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Thu, 13 May 2021 10:57:48 +0200 Subject: [PATCH] Handle empty address on Server.clean() --- orchestra/contrib/orchestration/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/orchestra/contrib/orchestration/models.py b/orchestra/contrib/orchestration/models.py index 95e0e4d4..14e8db2d 100644 --- a/orchestra/contrib/orchestration/models.py +++ b/orchestra/contrib/orchestration/models.py @@ -51,8 +51,9 @@ class Server(models.Model): def clean(self): self.name = self.name.strip() - self.address = self.address.strip() - if self.name and not self.address: + if self.address: + self.address = self.address.strip() + elif self.name: validate = OrValidator(validate_ip_address, validate_hostname) validate_hostname(self.name) try: