Esempio n. 1
0
def get_profile_by_nick(nick):
    user = None
    exception = False

    try:
        user = CsUser.filter(nick=nick).first()
    except Exception, ex:
        exception = True
        logging.exception(ex)
        sentry_client.captureException()
Esempio n. 2
0
def user_list_from_ids(ids, dict=True):
    temp_user = CsUser.filter(CsUser.id.in_(set(ids))).limit(50)

    if dict:
        user_list = []
        for u in temp_user:
            d = u._as_dict()
            extras = u.extended
            d.update(**extras)
            user_list.append(d)

        return user_list
    else:
        return temp_user
Esempio n. 3
0
def user_list_from_ids(ids, dict=True):
    temp_user = CsUser.filter(CsUser.id.in_(set(ids))).limit(50)

    if dict:
        user_list = []
        for u in temp_user:
            d = u._as_dict()
            extras = u.extended
            d.update(**extras)
            user_list.append(d)

        return user_list
    else:
        return temp_user
Esempio n. 4
0
def get_profile_by_nick(nick):
    user = CsUser.filter(nick=nick).first()
    if user is None:
        return

    return load_user(user.id)
Esempio n. 5
0
def get_user_discussion_by_nick(nick):
    try:
        user = CsUser.filter(nick=nick).first()
    except DoesNotExist, dne:
        user = None
Esempio n. 6
0
def get_user_timeline_by_nick(nick):
    try:
        user = CsUser.filter(nick=nick).first()
    except DoesNotExist, dne:
        user = None