brdevstreamers / brdevstreamers-api

Home Page:brdevstreamers-api.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle specific except for github and Twitter services

dunossauro opened this issue · comments

Qual exception está sendo esperada? Mais de uma?

def has_github_account(username):
    try:
        if username not in user_githubs:
            g = Github(config["GITHUB_TOKEN"])
            user = g.get_user(username)
            user_githubs[username] = True
    except:
        user_githubs[username] = False
def has_twitter_account(username):
    try:
        if username not in user_twitters:
            users = t.users.lookup(screen_name=username, _timeout=1)
            user_twitters[username] = len(users) > 0
    except:
        user_twitters[username] = False
        
    return user_twitters[username]

I believe we can remove these services as they are not necessary anymore. The user maintains their social networks in the DB.