Exemplo n.º 1
0
def addNewDL() -> render_template:
    """Зарегистрировать новые вод.удовст"""

    lastPage: str = session.get('lastPage') if session.get('lastPage') else '/'

    if request.method == 'POST':
        wallet: str = session.get('wallet')
        private_key: str = request.form['private_key']
        if 'catA' in request.form:
            catA: bool = True
        else:
            catA: bool = False

        if 'catB' in request.form:
            catB: bool = True
        else:
            catB: bool = False

        if 'catC' in request.form:
            catC: bool = True
        else:
            catC: bool = False

        response = User.addNewDL(wallet, private_key, catA, catB, catC)
        if response['status']:
            flash(response['msg'])
            return render_template('html/main.html',
                                   lastPage=lastPage,
                                   info=True)
        else:
            flash(response['msg'])
            return render_template('html/main.html',
                                   lastPage=lastPage,
                                   addRiderLicenceToBase=True)
Exemplo n.º 2
0
    def addNewDL(private_key: str, catA: bool, catB: bool, catC: bool) -> None:
        """Зарегистрировать новое вод.удост"""

        response: dict = User.addNewDL(functional.wallet, private_key, catA,
                                       catB, catC)

        if response['status']:
            cli.Logger.info(response['msg'])
        else:
            cli.Logger.warn(response['msg'])