You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importrequestsdefvalidate_github_profile(value):
"""validate github profile"""pattern=r"^github.com\/[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*\/?$"ifre.search(pattern, value) isNone:
raiseValidationError(
_("%(value)s is not a valid GitHub profile."),
params={"value": value},
)
status_code=requests.get(value).status_codeifstatus_code==404:
raiseValidationError(
_("%(value)s is not a valid GitHub profile."),
params={"value": value},
)
CodersHQ/codershq/users/validators.py
Line 15 in 40400f7
Why not just use an additional step that uses
request
to check if the userprofile exists or not? Like:The text was updated successfully, but these errors were encountered: