add support for automatic DM data lookup
This commit is contained in:
parent
556e254870
commit
e5a73bfe75
3 changed files with 39 additions and 11 deletions
|
@ -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]]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue