Added to profile template

This commit is contained in:
2011-07-28 14:56:56 +01:00
parent 230724c11f
commit d85b24d09f
2 changed files with 3 additions and 0 deletions

View File

@@ -142,6 +142,8 @@ setup.</p>
<p> <p>
<a href="{% url reddit.views.reddit_add %}" class="button">Add a Reddit account</a> <a href="{% url reddit.views.reddit_add %}" class="button">Add a Reddit account</a>
</p> </p>
<p>
Reddit account tagging is {% if user.profile.tag_reddit_accounts %}Enabled{% else %}Disabled{% endif %}. <a href="{% url sso.views.toggle_reddit_tagging %}">{% if user.profile.tag_reddit_accounts %}Disable{% else %}Enable{% endif %}</a>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@@ -294,6 +294,7 @@ def primarychar_change(request):
def toggle_reddit_tagging(request): def toggle_reddit_tagging(request):
profile = request.user.get_profile() profile = request.user.get_profile()
profile.tag_reddit_accounts = not profile.tag_reddit_accounts profile.tag_reddit_accounts = not profile.tag_reddit_accounts
profile.save()
if profile.tag_reddit_accounts: if profile.tag_reddit_accounts:
tag = 'Enabled' tag = 'Enabled'
else: else: