"""This is called as an internal redirect from /on/blah/associate """ import uuid from aspen import Response from gittip.models import Participant website.connect_tokens = {} # ===== ^L if not getattr(request, 'internally_redirected_from', None): raise Response(404) if user.ANON: raise Response(404) # Compute and store a connect_token. # ================================== # This is a protection against unauthorized users taking over accounts. connect_token = uuid.uuid4().hex connect_key = (user.username, account.platform, account.user_id) website.connect_tokens[connect_key] = connect_token other = Participant.query.get(account.participant) user_github_account, user_twitter_account, user_bitbucket_account = \ user.get_accounts_elsewhere() other_github_account, other_twitter_account, other_bitbucket_account = \ other.get_accounts_elsewhere() user_giving = user.get_dollars_giving() user_receiving = user.get_dollars_receiving() other_giving = other.get_dollars_giving() other_receiving = other.get_dollars_receiving() combined_giving = user_giving + other_giving combined_receiving = user_receiving + other_receiving fmt = lambda x: '$' + str(int(round(x))) if x > 0 else '-' if account.platform == 'twitter': username = user_info['screen_name'] elif account.platform == 'github': username = user_info['login'] elif account.platform == 'bitbucket': username = user_info['username'] title = "Please Confirm" # ===== ^L {% extends "templates/base.html" %} {% block box %}
|
{{ user.username }}
{% if user_twitter_account is not None %} {% end %} {% if user_github_account is not None %} {% end %} {% if user_bitbucket_account is not None %} {% end %} |
{{ other.username }}
{% if other_twitter_account is not None %} {% if account.platform == 'twitter' %}{% end %} {% end %} {% if other_github_account is not None %} {% if account.platform == 'github' %}{% end %} {% end %} {% if other_bitbucket_account is not None %} {% if account.platform == 'bitbucket' %}{% end %} {% end %} |
|
{% if account.platform == 'twitter' and user_twitter_account is not None %}
{% end %} {% if account.platform == 'github' and user_github_account is not None %} {% end %} {% if account.platform == 'bitbucket' and user_bitbucket_account is not None %} {% end %} |
{{ user.username }}
{% if user_twitter_account is not None %} {% end %} {% if user_github_account is not None %} {% end %} {% if user_bitbucket_account is not None %} {% end %} |
{% if obstacles.this_is_others_last_account_elsewhere %}
{{ other.username }} |
{% else %}
{{ other.username }}
{% if other_github_account is not None and account.platform != 'github' %} {% end %} {% if other_twitter_account is not None and account.platform != 'twitter' %} {% end %} |
{% end %}