eduagarcia commited on
Commit
8e2a724
1 Parent(s): 21f0ce7

Force login to make duplicate requests

Browse files
Files changed (1) hide show
  1. functions.py +2 -2
functions.py CHANGED
@@ -218,9 +218,9 @@ def commit(repo, pr_number=None, message=default_pull_request_title, oauth_token
218
  except Exception:
219
  raise gr.Error(f"Not a valid repo id: {str(repo)}")
220
 
221
- if check_if_pr_exists:
222
  if pr_already_exists(repo, token):
223
- return "PR already exists"
224
 
225
  edited = {"revision": f"refs/pr/{pr_number}"} if pr_number else {"create_pr": True}
226
 
 
218
  except Exception:
219
  raise gr.Error(f"Not a valid repo id: {str(repo)}")
220
 
221
+ if check_if_pr_exists or token == BOT_HF_TOKEN:
222
  if pr_already_exists(repo, token):
223
+ return "PR already exists, Login to make a duplicate PR"
224
 
225
  edited = {"revision": f"refs/pr/{pr_number}"} if pr_number else {"create_pr": True}
226