Example #1
0
def _get_user_via_api_key(api_key):
    """Given an api_key, return a User. This auth method is deprecated.
    """
    user = User(Participant._from_thing('api_key', api_key))
    if user.participant:
        p = user.participant
        today = date.today()
        if p.old_auth_usage != today:
            Participant.db.run("""
                UPDATE participants
                   SET old_auth_usage = %s
                 WHERE id = %s
            """, (today, p.id))
    return user
Example #2
0
def _get_user_via_api_key(api_key):
    """Given an api_key, return a User. This auth method is deprecated.
    """
    user = User(Participant._from_thing('api_key', api_key))
    if user.participant:
        p = user.participant
        today = date.today()
        if p.old_auth_usage != today:
            Participant.db.run(
                """
                UPDATE participants
                   SET old_auth_usage = %s
                 WHERE id = %s
            """, (today, p.id))
    return user