accept backends name with only letters and digits

This commit is contained in:
Romain Bignon 2010-11-14 22:18:56 +01:00
commit 0746942e02
2 changed files with 7 additions and 1 deletions

View file

@ -21,6 +21,7 @@ from PyQt4.QtGui import QDialog, QTreeWidgetItem, QLabel, QFormLayout, \
QDialogButtonBox
from PyQt4.QtCore import SIGNAL, Qt, QVariant, QUrl
import re
from logging import warning
from weboob.capabilities.account import ICapAccount, Account, AccountRegisterError
@ -206,6 +207,11 @@ class BackendCfg(QDialog):
self.tr('Please specify a backend name'))
return
if self.ui.nameEdit.isEnabled() and not re.match(r'^[\w\-_]+$', bname):
QMessageBox.critical(self, self.tr('Invalid value'),
self.tr('The backend name can only contain letters and digits'))
return
if self.ui.proxyBox.isChecked():
params['_proxy'] = unicode(self.ui.proxyEdit.text())
if not params['_proxy']: