Beispiel #1
0
def mirrors_delete():
    user = require_user()
    # Delete a mirror
    mid = int(request.form.get('id'))
    m = Mirror(mid)
    if m.exists() and m.get_owner().get_username() == user.get_username():
        m.delete(False)
        abort(200)
    else:
        abort(403)
Beispiel #2
0
def mirror_name():
    user = require_user()
    name = request.form.get('name', None)
    mid = int(request.form.get('id'))
    m = Mirror(mid)
    if name != None and m.exists() and m.get_owner().get_username() == user.get_username():
        # Change name
        m.change_name(name)
        abort(200)
    else:
        abort(403)