before if sreg sreg join arg for arg in sreg split if arg nickname or

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# before
if sreg:
sreg = ','.join([arg for arg in sreg.split(',') if arg != 'nickname' or arg != 'email'])
extension_args['sreg.optional'] = 'email,nickname'
if sreg:
extension_args['sreg.optional'] += ',' + sreg
#after
sreg = set(self.sreg.split(',')).union(['email', 'nickname'])
self.extendsion_args['sreg.optional'] = ','.join(sreg)