comparison src/memory/params.py @ 1497:7a9cef71ae43

core (params): fixes jid_list to use node's default value when no user value is defined
author souliane <souliane@mailoo.org>
date Sat, 22 Aug 2015 10:28:07 +0200
parents de71cd99ba9b
children fbe86b5d156f
comparison
equal deleted inserted replaced
1496:de71cd99ba9b 1497:7a9cef71ae43
371 log.error(_(u'Parameter (%(cat)s, %(param)s) of type list has no default option!') % {'cat': cat, 'param': param}) 371 log.error(_(u'Parameter (%(cat)s, %(param)s) of type list has no default option!') % {'cat': cat, 'param': param})
372 else: 372 else:
373 log.error(_(u'Parameter (%(cat)s, %(param)s) of type list has more than one default option!') % {'cat': cat, 'param': param}) 373 log.error(_(u'Parameter (%(cat)s, %(param)s) of type list has more than one default option!') % {'cat': cat, 'param': param})
374 raise exceptions.DataError 374 raise exceptions.DataError
375 elif node.getAttribute('type') == 'jids_list': 375 elif node.getAttribute('type') == 'jids_list':
376 if not value: 376 if not value_to_use:
377 log.debug(u"jids list value is empty") 377 log.debug(u"jids list value is empty")
378 return [] 378 return []
379 jids = value.split('\t') 379 jids = value_to_use.split('\t')
380 to_delete = [] 380 to_delete = []
381 for idx, value in enumerate(jids): 381 for idx, value in enumerate(jids):
382 try: 382 try:
383 jids[idx] = jid.JID(value) 383 jids[idx] = jid.JID(value)
384 except jid.InvalidFormat: 384 except jid.InvalidFormat: