Skip to content

Commit f095641

Browse files
[Fixes #13009] fix tests
1 parent 234c98c commit f095641

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

geonode/services/forms.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def clean(self):
8181
base_url=url,
8282
service_type=service_type,
8383
username=self.cleaned_data.get("username", None),
84-
password=self.cleaned_data.get("password", ""),
84+
password=self.cleaned_data.get("password", None),
8585
)
8686
except Exception as e:
8787
logger.error(f"CreateServiceForm cleaning error: {e}")
@@ -97,6 +97,14 @@ def clean(self):
9797
self.cleaned_data["service_handler"] = service_handler
9898
self.cleaned_data["type"] = service_handler.service_type
9999

100+
def clean_username(self):
101+
# the form return empty string, we want None if is not provided
102+
return self.cleaned_data['username'] or None
103+
104+
def clean_password(self):
105+
# the form return empty string, we want None if is not provided
106+
return self.cleaned_data['password'] or None
107+
100108

101109
class ServiceForm(forms.ModelForm):
102110
title = forms.CharField(

0 commit comments

Comments
 (0)