Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Remove the bookmarks filter if anon user #398 #444

Closed
wants to merge 1 commit into from

3 participants

@robcowie

Attempting to filter by bookmarks when not logged in currently fails hard (see #398)

This patch removes the "Only Bookmarks" link from the sidebar, and ignores ?bookmarks=1 if the user is anonymous.

I'm not convinced removing the link makes for a good UX. Perhaps disabling it in some way is a better option. Let me know what you guys prefer and I'll modify accordingly.

@robcowie robcowie Remove the bookmarks filter is anon user #398
* Remove the "Only Bookmarks" filter from the sidebar
* Ignore ?bookmarks=1 if anon user
e2387ff
@heynemann

This seems like a good pull request. Sentry should never 500.

Any idea on why this hasn't been merged?

@dcramer
Owner

I believe you have to be logged in now anyways so this is invalid

@dcramer dcramer closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 21, 2012
  1. @robcowie

    Remove the bookmarks filter is anon user #398

    robcowie authored
    * Remove the "Only Bookmarks" filter from the sidebar
    * Ignore ?bookmarks=1 if anon user
This page is out of date. Refresh to see the latest.
View
5 sentry/templates/sentry/groups/group_list.html
@@ -34,10 +34,13 @@
{% block sidebar %}
{% querystring from request without bookmarks as bookmark_querystring %}
<h6>{% trans "Bookmarks" %}</h6>
- <form>
<ul class="nav nav-tabs nav-stacked filter-list">
+ {% if request.user.is_anonymous %}
+ <li class="active"><a href="?">{% trans "All Events" %}</a></li>
+ {% else %}
<li{% if not request.GET.bookmarks %} class="active"{% endif %}><a href="?{{ bookmark_querystring }}">{% trans "All Events" %}</a></li>
<li{% if request.GET.bookmarks %} class="active"{% endif %}><a href="?{{ bookmark_querystring }}&amp;bookmarks=1">{% trans "Only Bookmarks" %}</a></li>
+ {% endif %}
</ul>
{% for filter in filters %}
View
10 sentry/web/frontend/groups.py
@@ -58,10 +58,12 @@ def _get_group_list(request, project, view=None):
event_list = Group.objects
if request.GET.get('bookmarks'):
- event_list = event_list.filter(
- bookmark_set__project=project,
- bookmark_set__user=request.user,
- )
+ # Ignore this filter if anon user
+ if not request.user.is_anonymous():
+ event_list = event_list.filter(
+ bookmark_set__project=project,
+ bookmark_set__user=request.user,
+ )
else:
event_list = event_list.filter(project=project)
Something went wrong with that request. Please try again.