Skip to content

Commit

Permalink
Catch if user is not logged in for widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
authmillenon committed Mar 17, 2012
1 parent f77a77a commit 71ab0fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions give/views/__init__.py
Expand Up @@ -163,6 +163,8 @@ def widget_doc(request):


def widget_give_datalove(request, username):
if not request.user.is_authenticated():
return redirect(index)
query = common.give_datalove(request, username, query={'user': username})
return query_redirect(widget, query)

Expand Down
4 changes: 4 additions & 0 deletions templates/give/widget.html
Expand Up @@ -45,7 +45,11 @@
<title>~~~~=:) - give.datalove.me - (:=~~~~</title>
</head>
<body>
{% if logged_in %}
<a href="{% url widget_give_datalove profile.username %}">
{% else %}
<a href="{% url index %}" target="_blank">
{% endif %}
<div class="widget">
<div class="received_love">
{{ profile.received_love|stringformat:"012d" }}
Expand Down

0 comments on commit 71ab0fe

Please sign in to comment.