Skip to content

Commit

Permalink
Add support for ASREVIEW_LAB_SQLALCHEMY_DATABASE_URI in auth-tool
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 committed Mar 20, 2024
1 parent 5f3c398 commit 7f52f1c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions asreview/webapp/entry_points/auth_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def auth_parser():
type=str,
default=None,
help=("URI of the database. By default, the value is given by the environment "
"variable SQLALCHEMY_DATABASE_URI. If not set, the default is "
"'asreview.production.sqlite' in the ASReview folder."),
"variable ASREVIEW_LAB_SQLALCHEMY_DATABASE_URI. If not set, the default "
"is 'asreview.production.sqlite' in the ASReview folder."),
)

# ADD USERS
Expand All @@ -64,8 +64,8 @@ def auth_parser():
type=str,
default=None,
help=("URI of the database. By default, the value is given by the environment "
"variable SQLALCHEMY_DATABASE_URI. If not set, the default is "
"'asreview.production.sqlite' in the ASReview folder."),
"variable ASREVIEW_LAB_SQLALCHEMY_DATABASE_URI. If not set, the default "
"is 'asreview.production.sqlite' in the ASReview folder."),
)

user_par.add_argument(
Expand All @@ -87,8 +87,8 @@ def auth_parser():
type=str,
default=None,
help=("URI of the database. By default, the value is given by the environment "
"variable SQLALCHEMY_DATABASE_URI. If not set, the default is "
"'asreview.production.sqlite' in the ASReview folder."),
"variable ASREVIEW_LAB_SQLALCHEMY_DATABASE_URI. If not set, the default "
"is 'asreview.production.sqlite' in the ASReview folder."),
)

# LIST PROJECTS
Expand Down Expand Up @@ -122,8 +122,8 @@ def auth_parser():
type=str,
default=None,
help=("URI of the database. By default, the value is given by the environment "
"variable SQLALCHEMY_DATABASE_URI. If not set, the default is "
"'asreview.production.sqlite' in the ASReview folder."),
"variable ASREVIEW_LAB_SQLALCHEMY_DATABASE_URI. If not set, the default "
"is 'asreview.production.sqlite' in the ASReview folder."),
)

return parser
Expand Down Expand Up @@ -200,6 +200,7 @@ def execute(self, argv):
if self.argv != ["list-projects"]:
self.uri = getattr(self.args, "db_uri", False) or \
os.environ.get("SQLALCHEMY_DATABASE_URI", False) or \
os.environ.get("ASREVIEW_LAB_SQLALCHEMY_DATABASE_URI", False) or \
DEFAULT_DATABASE_URI
Session = sessionmaker()
engine = create_engine(self.uri)
Expand Down

0 comments on commit 7f52f1c

Please sign in to comment.