forked from jan/debianmemberportfolio
accept extra fields forumsid and wikihomepage
This commit is contained in:
parent
2b6e6869f7
commit
c3afa11013
3 changed files with 8 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service DdportfolioController
|
# DDPortfolio service DdportfolioController
|
||||||
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -156,7 +156,8 @@ developer name on all bug logs)'),
|
||||||
except formencode.validators.Invalid, error:
|
except formencode.validators.Invalid, error:
|
||||||
c.messages = { 'errors' : error.unpack_errors() }
|
c.messages = { 'errors' : error.unpack_errors() }
|
||||||
return render('/showform.mako')
|
return render('/showform.mako')
|
||||||
data = build_urls(rp)
|
data = build_urls(form_result)
|
||||||
|
log.debug("data %r", data)
|
||||||
if 'mode' in rp and rp['mode'] == 'json':
|
if 'mode' in rp and rp['mode'] == 'json':
|
||||||
response.headers['Content-Type'] = 'text/javascript'
|
response.headers['Content-Type'] = 'text/javascript'
|
||||||
return simplejson.dumps(
|
return simplejson.dumps(
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service form handling model
|
# DDPortfolio service form handling model
|
||||||
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -35,6 +35,8 @@ class DeveloperData(formencode.Schema):
|
||||||
nonddemail = formencode.validators.Email()
|
nonddemail = formencode.validators.Email()
|
||||||
aliothusername = formencode.validators.PlainText()
|
aliothusername = formencode.validators.PlainText()
|
||||||
mode = formencode.validators.OneOf([u'json', u'html'], not_empty=True)
|
mode = formencode.validators.OneOf([u'json', u'html'], not_empty=True)
|
||||||
|
forumsid = formencode.validators.Int(if_missing=None)
|
||||||
|
wikihomepage = formencode.validators.String(if_missing=None)
|
||||||
|
|
||||||
class DDDataRequest(formencode.Schema):
|
class DDDataRequest(formencode.Schema):
|
||||||
"""Validation schema for DDData request."""
|
"""Validation schema for DDData request."""
|
||||||
|
|
|
@ -51,7 +51,8 @@ def build_urls(fields):
|
||||||
fields."""
|
fields."""
|
||||||
data = []
|
data = []
|
||||||
qfields = dict([(key, quote_plus(fields[key].encode('utf8'))) \
|
qfields = dict([(key, quote_plus(fields[key].encode('utf8'))) \
|
||||||
for key in fields if fields[key] is not None])
|
for key in fields \
|
||||||
|
if fields[key] is not None and isinstance(fields[key], unicode)])
|
||||||
if 'gpgfp' not in qfields:
|
if 'gpgfp' not in qfields:
|
||||||
fpr = keyfinder.getFingerprintByEmail(fields['email'].encode('utf8'))
|
fpr = keyfinder.getFingerprintByEmail(fields['email'].encode('utf8'))
|
||||||
if fpr:
|
if fpr:
|
||||||
|
|
Loading…
Reference in a new issue