remove dead code

pull/1/head
radex 2023-09-22 21:18:53 +02:00
parent bdfefcb234
commit 84abc355b9
2 changed files with 1 additions and 27 deletions

View File

@ -47,14 +47,3 @@ def refresh_profile(dn=None):
profile[a.uid] = a
app.profiles[dn] = profile
return profile
def generate_token():
dn = get_dn()
token = ''.join(random.choice(string.letters) for i in xrange(config.TOKEN_LENGTH))
app.tokens.insert(dn, token)
def get_token():
dn = get_dn()
return app.tokens[dn]

View File

@ -22,15 +22,6 @@ def login_required(f):
return f(*a, **kw)
return func
def api_access(f):
@functools.wraps(f)
def func(*a, **kw):
dn = flask.request.environ.get('PEER_DN')
if dn not in config.api_allowed:
return flask.abort(403)
return f(*a, **kw)
return func
def req_to_ctx():
return dict(flask.request.form.items())
@ -183,12 +174,6 @@ def passwd_action():
flask.flash(u'Wrong password', category='danger')
return flask.render_template('passwd.html')
@app.route('/request_token', methods=['GET'])
@login_required
def request_token():
context.generate_token()
return flask.redirect('/vcard')
@app.route("/")
@login_required
def root():
@ -200,7 +185,7 @@ def vcard():
data = {}
for v in context.get_profile().values():
data.setdefault(v.name, []).append(v)
return flask.render_template('vcard.html', token=context.get_token(), can_add=config.can['add'],
return flask.render_template('vcard.html', can_add=config.can['add'],
can_modify=config.can['mod'], can_delete=config.can['del'], profile=data)
@app.route('/vcard/add/<attrName>', methods=['GET', 'POST'])