Skip to content

Commit

Permalink
Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSuperiorStanislav committed Nov 9, 2023
1 parent 169bb4b commit 5b280c1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions saritasa_invocations/alembic.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def _get_migration_files_paths(
def load_db_dump(
context: invoke.Context,
file: str = "",
env_file_path: str = "",
env_file_path: str = ".env",
reset_db: bool = True,
) -> None:
"""Reset db and load db dump."""
Expand All @@ -211,12 +211,13 @@ def load_db_dump(
def backup_local_db(
context: invoke.Context,
file: str = "",
env_file_path: str = ".env",
) -> None:
"""Back up local db."""
db.backup_local_db(
context,
file=file,
**_load_local_env_db_settings(context),
**_load_local_env_db_settings(context, file=env_file_path),
)


Expand All @@ -243,7 +244,7 @@ def load_remote_db(

def _load_local_env_db_settings(
context: invoke.Context,
file: str = "",
file: str,
) -> dict[str, str]:
"""Load local db settings from .env file.
Expand All @@ -256,7 +257,7 @@ def _load_local_env_db_settings(
# during project initialization
import decouple

secrets = decouple.Config(decouple.RepositoryEnv(file or ".env"))
secrets = decouple.Config(decouple.RepositoryEnv(file))
config = _config.Config.from_context(context)
return {
arg: str(secrets(env_var))
Expand Down

0 comments on commit 5b280c1

Please sign in to comment.