Exemple #1
0
def management():
    """ This endpoint is for vieweing and adding users and clients. """
    if request.method == 'POST' and request.form['submit'] == 'Add User':
        User.save(request.form['username'], request.form['password'])
    if request.method == 'POST' and request.form['submit'] == 'Add Client':
        Client.generate()
    return render_template('management.html', users=User.all(),
                           clients=Client.all())
Exemple #2
0
def management():
    """ This endpoint is for vieweing and adding users and clients. """
    if request.method == 'POST' and request.form['submit'] == 'Add User':
        User.save(request.form['username'], request.form['password'])
    if request.method == 'POST' and request.form['submit'] == 'Add Client':
        Client.generate()
    return render_template('management.html',
                           users=User.all(),
                           clients=Client.all())
def management():
    """Provides a quick management screen for users, clients and tokens."""
    if request.method == 'POST' and request.form['submit'] == 'Add User':
        # Create a new user if the 'Add User' form has been sent.
        User.save(request.form['username'], request.form['password'])
    if request.method == 'POST' and request.form['submit'] == 'Add Client':
        # Create a new client if the 'Add Client' form has been sent.
        Client.generate()
    # Show the management page.
    return render_template(
        'management.html',
        users=User.all(),
        clients=Client.all(),
        tokens=Token.all()
    )
Exemple #4
0
 def getClient(self, shortCode, createNew = False):
     return Client.all().filter('shortCode =', shortCode).get()
Exemple #5
0
 def getClient(self, shortCode, createNew=False):
     return Client.all().filter('shortCode =', shortCode).get()
Exemple #6
0
def management():
    if request.method == 'POST' and request.form['submit'] == 'Add Client':
        Client.generate()
    return render_template('management.html', clients=Client.all())
Exemple #7
0
def list_clients():
    clients = Client.all()
    clients_new = []
    for client in clients:
        clients_new.append(client.serialize())
    return make_response(jsonify(clients_new), status.HTTP_200_OK)