@@ -159,12 +159,18 @@ def save(self):
159
159
Create and emit a ServiceData object based
160
160
on the contents of the form.
161
161
"""
162
- if len (str (self .name .text ())) < 3 :
162
+ service_name = str (self .name .text ())
163
+ if len (service_name ) < 3 :
163
164
QtWidgets .QMessageBox .critical (self , "Error" ,
164
165
"The service name must be at least 3 characters." )
165
166
return
166
167
167
- if not str (self .name .text ()).isalnum ():
168
+ # Allow alphanumeric chars and | / - _
169
+ # chars like , and . can be used as separators in other parts of the API and behave
170
+ # inconsistently
171
+ if (not service_name .isalnum ()) and \
172
+ [char for char in service_name
173
+ if not char .isalnum () and char not in "|/-_" ]:
168
174
QtWidgets .QMessageBox .critical (self , "Error" , "The service name must alphanumeric." )
169
175
return
170
176
@@ -176,7 +182,7 @@ def save(self):
176
182
service = opencue .wrappers .service .Service ()
177
183
if self .__service :
178
184
service .data .id = self .__service .data .id
179
- service .setName (str ( self . name . text ()) )
185
+ service .setName (service_name )
180
186
service .setThreadable (self .threadable .isChecked ())
181
187
service .setMinCores (self .min_cores .value ())
182
188
service .setMaxCores (self .max_cores .value ())
0 commit comments