Skip to content

Commit 09e394a

Browse files
committed
refactor: Replaced if-condition with dict.get
1 parent 3177a81 commit 09e394a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

jupyterlab_git/handlers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ def post(self):
3232
}
3333
"""
3434
data = json.loads(self.request.body.decode('utf-8'))
35-
if 'auth' in data.keys():
36-
response = self.git.clone(data['current_path'], data['clone_url'], data['auth'])
37-
else:
38-
response = self.git.clone(data['current_path'], data['clone_url'])
35+
response = self.git.clone(data['current_path'], data['clone_url'], data.get('auth', None))
3936
self.finish(json.dumps(response))
4037

4138

0 commit comments

Comments
 (0)