Skip to content

Commit 29a6717

Browse files
committed
Require both username and password to be set
The HTTP Basic Auth requires both a username and password. The typing in the requests library does so as well.
1 parent 2141633 commit 29a6717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

misc-tools/dj_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def do_api_request(name: str, method: str = 'GET', jsonData: dict = {}):
7979
url = f'{domjudge_webapp_folder_or_api_url}/{name}'
8080
parsed = urlparse(domjudge_webapp_folder_or_api_url)
8181
auth = None
82-
if parsed.username or parsed.password:
82+
if parsed.username and parsed.password:
8383
auth = (parsed.username, parsed.password)
8484

8585
try:

0 commit comments

Comments
 (0)