Skip to content

Commit

Permalink
fix database variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
nurbal committed Mar 12, 2023
1 parent bf7905a commit 1c3db73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sarc/cli/db/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class DbInit:

def execute(self) -> int:
cfg = config()
url = cfg.mongo.url if self.url is None else self.url
database = cfg.mongo.database if self.database is None else self.database
url = cfg.mongo.connection_string if self.url is None else self.url
database = cfg.mongo.database_name if self.database is None else self.database

client = pymongo.MongoClient(url)
db = client.get_database(database)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/cli/db/test_db_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@pytest.mark.usefixtures("empty_read_write_db")
def test_db_init(cli_main):
db = config().mongo.instance
db = config().mongo.database_instance

# NOTE: Use instead these clases to get the collections once `users` is harmonized with the others.
# from sarc.allocations.allocations import AllocationsRepository
Expand Down

0 comments on commit 1c3db73

Please sign in to comment.