Skip to content

Commit

Permalink
Fix case port is empty, for backend with only url
Browse files Browse the repository at this point in the history
Ref #311
  • Loading branch information
algorys committed Apr 13, 2018
1 parent c457677 commit 356a7db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion alignak_app/qobjects/login/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ def handle_server(): # pragma: no cover - not testable
server_dialog.initialize_dialog()

if server_dialog.exec_() == QDialog.Accepted:
backend_url = '%(url)s:' + str(server_dialog.server_port.text()).rstrip()
if server_dialog.server_port.text().rstrip():
backend_url = '%(url)s:' + str(server_dialog.server_port.text()).rstrip()
else:
backend_url = '%(url)s'
settings.set_config('Alignak', 'backend', backend_url)
settings.set_config(
'Alignak', 'url', str(server_dialog.server_url.text()).rstrip())
Expand Down
3 changes: 0 additions & 3 deletions alignak_app/qobjects/login/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ def get_settings_widget(self):
self.server_proc.setPlaceholderText(_('alignak backend processes...'))
self.server_proc.setFixedHeight(25)
server_layout.addWidget(self.server_proc)
else:
self.server_proc.setText(settings.get_config('Alignak', 'processes'))
self.server_proc.setEnabled(False)

# Valid Button
valid_btn = QPushButton(_('Valid'))
Expand Down

0 comments on commit 356a7db

Please sign in to comment.