From 919670658672c7f1c34fe494c8623f06f54b20d4 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 28 Sep 2010 15:17:46 +0100 Subject: [PATCH] Cleanup profile view --- sso/views.py | 15 --------------- templates/sso/profile.html | 14 +++++++------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/sso/views.py b/sso/views.py index 07efad9..691e702 100644 --- a/sso/views.py +++ b/sso/views.py @@ -37,21 +37,6 @@ def profile(request): profile = SSOUser(user=request.user) profile.save() - try: - srvaccounts = ServiceAccount.objects.filter(user=request.user).all() - except ServiceAccount.DoesNotExist: - srvaccounts = None - - try: - redditaccounts = RedditAccount.objects.filter(user=request.user).all() - except ServiceAccount.DoesNotExist: - redditaccounts = None - - try: - eveaccounts = EVEAccount.objects.filter(user=request.user).all() - except EVEAccount.DoesNotExist: - eveaccounts = None - return render_to_response('sso/profile.html', locals(), context_instance=RequestContext(request)) @login_required diff --git a/templates/sso/profile.html b/templates/sso/profile.html index 6d59eea..ec4276a 100644 --- a/templates/sso/profile.html +++ b/templates/sso/profile.html @@ -17,17 +17,17 @@

To reset your External API Auth Services password, which is used to access tools and websites which use Auth's API, click the link below

Reset External API Auth Services Password

-{% if eveaccounts %} +{% if user.eveaccount_set.all %}

External non-API Service Accounts

This is a list of all your current non-api external service accounts, to create a login for a service click the Add Service link

-{% if srvaccounts %} +{% if user.serviceaccount_set.all %} -{% for acc in srvaccounts %} +{% for acc in user.serviceaccount_set.all %} @@ -60,13 +60,13 @@ corporation. Limited keys are accepted for service validation. API keys are stored for on-going authentication. As the assigned owner of a key you may remove them at any time, but this may affect any existing services you have setup.

-{% if eveaccounts %} +{% if user.eveaccount_set.all %}
ServiceUsernameURLActiveActions
{{ acc.service }} {{ acc.service_uid }} {{ acc.service.url }}
-{% for acc in eveaccounts %} +{% for acc in user.eveaccount_set.all %} @@ -89,14 +89,14 @@ setup.

Reddit Accounts

This is a list of all your current linked Reddit accounts

-{% if redditaccounts %} +{% if user.redditaccount_set.all %}

To validate your Reddit account, login on Reddit then click the link next to the account, fill in some text in the message and click send.

User IDAPI KeyDescriptionTypeActiveLast UpdatedActions
{{ acc.api_user_id }} {{ acc.api_key }} {{ acc.description }}
-{% for acc in redditaccounts %} +{% for acc in user.redditaccount_set.all %}
UsernameCreated DateValidated
{{ acc.username }} {{ acc.date_created }} {% if acc.validated %}Yes{% else %}No (Validate){% endif %}