Skip to content

Commit

Permalink
Fix mongo url with user/password (#291)
Browse files Browse the repository at this point in the history
* Fix mongo url with user/password

* Update black formatting

Co-authored-by: Esa Jokinen <[email protected]>

* black formatting changes

---------

Co-authored-by: PT <[email protected]>
Co-authored-by: Esa Jokinen <[email protected]>
Co-authored-by: Paul Tikken <[email protected]>
  • Loading branch information
4 people authored Jun 17, 2024
1 parent b8b58d8 commit fec39f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CveXplore/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ def __init__(self, **kwargs):
else:
if self.datasource_type == "mongodb":
self._datasource_connection_details = {
"host": f"{self.config.DATASOURCE_PROTOCOL}://{self.config.DATASOURCE_HOST}:{self.config.DATASOURCE_PORT}"
"host": (
f"{self.config.DATASOURCE_PROTOCOL}://{self.config.DATASOURCE_HOST}:{self.config.DATASOURCE_PORT}"
if self.config.DATASOURCE_USER is None
and self.config.DATASOURCE_PASSWORD is None
else f"{self.config.DATASOURCE_PROTOCOL}://{self.config.DATASOURCE_USER}:{self.config.DATASOURCE_PASSWORD}@{self.config.DATASOURCE_HOST}:{self.config.DATASOURCE_PORT}"
)
}
elif self.datasource_type == "mysql":
self._datasource_connection_details = {
Expand Down

0 comments on commit fec39f7

Please sign in to comment.