Skip to content

Commit

Permalink
Enable pyright reportOptionalSubscript (#611)
Browse files Browse the repository at this point in the history
* Enable pyright reportPrivateImportUsage.

* Enable pyright reportOptionalSubscript.
  • Loading branch information
janjagusch authored Feb 18, 2023
1 parent 7ed1e4a commit 77d05ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ reportMissingModuleSource = false
reportMissingTypeStubs = false
reportOptionalMemberAccess = false
reportOptionalOperand = false
reportOptionalSubscript = false
reportOptionalSubscript = true
reportPrivateImportUsage = true
reportUnboundVariable = false
reportUndefinedVariable = false
Expand Down
4 changes: 3 additions & 1 deletion quetz/authentication/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ def configure(self, config):
async def authenticate(
self, request: Request, data=None, dao=None, config=None, **kwargs
) -> Optional[str]:
if data["username"] == data["password"]:
if data is None:
return None
elif data["username"] == data["password"]:
return data['username']
else:
return None
2 changes: 1 addition & 1 deletion quetz/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def run_migrations_online():
and associate a connection with the context.
"""
configuration = config.get_section(config.config_ini_section)
configuration = config.get_section(config.config_ini_section, {})
configuration["sqlalchemy.url"] = get_url()
connection = config.attributes.get('connection', None)

Expand Down

0 comments on commit 77d05ba

Please sign in to comment.