multimodalart HF staff commited on
Commit
2d75e4d
·
1 Parent(s): 8812323

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -182,11 +182,14 @@ def check_civit_link(profile: Optional[gr.OAuthProfile], url):
182
  info, _ = process_url(url, download_files=False)
183
  hf_username = extract_huggingface_username(info['creator'])
184
  print(hf_username)
185
- print(dir(profile))
 
 
 
186
  if(not hf_username):
187
  no_username_text = 'Oops, your CivitAI profile seems to not have information about your Hugging Face account. Please visit <a href="https://civitai.com/user/account">https://civitai.com/user/account</a> and include it there<br><img width="60%" src="https://i.imgur.com/hCbo9uL.png" />'
188
  return no_username_text, gr.update(), gr.update(visible=True)
189
- if(profile.user != hf_username):
190
  unmatched_username_text = 'Oops, the Hugging Face account in your CivitAI profile seems to be different than the one your are using here. Please visit <a href="https://civitai.com/user/account">https://civitai.com/user/account</a> and update it there<br><img src="https://i.imgur.com/hCbo9uL.png" />'
191
  return unmatched_username_text, gr.update(), gr.update(visible=True)
192
  else:
 
182
  info, _ = process_url(url, download_files=False)
183
  hf_username = extract_huggingface_username(info['creator'])
184
  print(hf_username)
185
+ attributes_methods = dir(profile)
186
+ for attribute in attributes_methods:
187
+ if not attribute.startswith('__'):
188
+ print(f"{attribute}: {getattr(profile, attribute)}")
189
  if(not hf_username):
190
  no_username_text = 'Oops, your CivitAI profile seems to not have information about your Hugging Face account. Please visit <a href="https://civitai.com/user/account">https://civitai.com/user/account</a> and include it there<br><img width="60%" src="https://i.imgur.com/hCbo9uL.png" />'
191
  return no_username_text, gr.update(), gr.update(visible=True)
192
+ if(profile.preferred_username != hf_username):
193
  unmatched_username_text = 'Oops, the Hugging Face account in your CivitAI profile seems to be different than the one your are using here. Please visit <a href="https://civitai.com/user/account">https://civitai.com/user/account</a> and update it there<br><img src="https://i.imgur.com/hCbo9uL.png" />'
194
  return unmatched_username_text, gr.update(), gr.update(visible=True)
195
  else: