def delete_event(request, event_key): e = None try: e = AutoRetry(PlaylistEvent).get(event_key) except BadKeyError: pass else: if e and e.selector.key() == auth.get_current_user(request).key(): e.delete() playlist_event_listeners.delete(event_key) return HttpResponseRedirect(reverse("playlists_landing_page"))
def delete_event(request, event_key): e = None try: e = AutoRetry(PlaylistEvent).get(event_key) except BadKeyError: pass else: if e and e.selector.key() == auth.get_current_user(request).key(): e.delete() playlist_event_listeners.delete(event_key) return HttpResponseRedirect(reverse('playlists_landing_page'))
def delete_event(request, event_key): e = None try: e = AutoRetry(PlaylistEvent).get(event_key) except BadKeyError: pass else: if e and e.selector.key() == auth.get_current_user(request).key(): e.delete() # This avoids seeing dupes after deleting the last # submitted track. memcache.delete('playlist.last_track') playlist_event_listeners.delete(event_key) return HttpResponseRedirect(reverse('playlists_landing_page'))