add support for automatic DM data lookup

This commit is contained in:
Jan Dittberner 2010-06-11 21:42:30 +02:00
parent 556e254870
commit e5a73bfe75
3 changed files with 39 additions and 11 deletions

View file

@ -144,12 +144,19 @@ developer name on all bug logs)'),
return render('/showform.mako')
fields = dddatabuilder.build_data(form_result['email'])
rp = request.params.copy()
if fields['isdd']:
for tuple in (('name', 'name'),
('gpgfp', 'gpgfp'),
('username', 'username'),
('aliothusername', 'username'),
('nonddemail', 'email')):
DM_TUPLES = (('name', 'name'),
('gpgfp', 'gpgfp'),
('nonddemail', 'email'))
DD_TUPLES = (('username', 'username'),
('aliothusername', 'username'))
if fields['type'] in (dddatabuilder.TYPE_DD, dddatabuilder.TYPE_DM):
for tuple in DM_TUPLES:
if not tuple[0] in rp or not rp[tuple[0]]:
rp[tuple[0]] = fields[tuple[1]]
if fields['type'] == dddatabuilder.TYPE_DD:
for tuple in DD_TUPLES:
if not tuple[0] in rp or not rp[tuple[0]]:
rp[tuple[0]] = fields[tuple[1]]