3 Commits

Author SHA1 Message Date
4ee7f0a609 Added installation of g++ to Dockerfile 2022-11-01 09:26:13 +00:00
ae2b214904 Fixed an error of getting wrong account
I'm now quite shure how it worked before
2022-10-31 21:09:12 +03:00
01ab461d28 Added message of failure to add account 2022-10-31 20:40:53 +03:00
3 changed files with 8 additions and 4 deletions

View File

@ -13,7 +13,7 @@ RUN adduser -u 1000 --disabled-password --gecos "" appuser && chown -R appuser /
# Install deps # Install deps
RUN apt update && apt full-upgrade -y RUN apt update && apt full-upgrade -y
RUN apt install curl gcc -y RUN apt install curl gcc g++ -y
RUN curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash RUN curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash
RUN apt install libmariadb3 libmariadb-dev -y RUN apt install libmariadb3 libmariadb-dev -y

View File

@ -219,9 +219,13 @@ def _add_account5(
login, passwd, text.encode("utf-8") login, passwd, text.encode("utf-8")
) )
database.add.add_account(engine, mes.from_user.id, name, salt, enc_login, enc_pass) result = database.add.add_account(
engine, mes.from_user.id, name, salt, enc_login, enc_pass
)
_send_tmp_message(bot, mes.chat.id, "Успех") _send_tmp_message(
bot, mes.chat.id, "Успех" if result else "Произошла не предвиденная ошибка"
)
del data, name, login, passwd, enc_login del data, name, login, passwd, enc_login

View File

@ -29,7 +29,7 @@ def get_account_info(
) -> tuple[bytes, bytes, bytes]: ) -> tuple[bytes, bytes, bytes]:
"""Gets account info. Returns tuple of salt, login and password""" """Gets account info. Returns tuple of salt, login and password"""
statement = sqlmodel.select(models.Account).where( statement = sqlmodel.select(models.Account).where(
models.Account.user_id == user_id and models.Account.name == name models.Account.user_id == user_id, models.Account.name == name
) )
with sqlmodel.Session(engine) as session: with sqlmodel.Session(engine) as session:
result = session.exec(statement).first() result = session.exec(statement).first()