Skip to content

Commit 4c0f8e4

Browse files
committed
fix the issues with loading empty users data for admin user
1 parent 7faf90a commit 4c0f8e4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/ui.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,11 @@ def open_folder(f):
672672
extras_submit = None
673673

674674
def update_sagemaker_endpoint():
675-
print(shared.opts.sagemaker_endpoint)
675+
print('---sagemaker_endpoint---', shared.opts.sagemaker_endpoint)
676676
return gr.update(value=shared.opts.sagemaker_endpoint, choices=shared.sagemaker_endpoints)
677677

678678
def update_sd_model_checkpoint():
679-
print(shared.opts.sd_model_checkpoint)
679+
print('---sd_model_checkpoint---', shared.opts.sd_model_checkpoint)
680680
return gr.update(value=shared.opts.sd_model_checkpoint, choices=modules.sd_models.checkpoint_tiles())
681681

682682
def update_username():
@@ -685,12 +685,11 @@ def update_username():
685685
'action': 'load'
686686
}
687687
response = requests.post(url=f'{shared.api_endpoint}/sd/user', json=inputs)
688-
print(response.text)
689688
if response.status_code == 200:
690689
items = []
691690
for item in json.loads(response.text):
692691
items.append([item['username'], item['password'], item['options'] if 'options' in item else ''])
693-
return gr.update(value=shared.username), gr.update(value=items)
692+
return gr.update(value=shared.username), gr.update(value=items if items != [] else None)
694693
else:
695694
return gr.update(value=shared.username), gr.update()
696695
else:

0 commit comments

Comments
 (0)