From f1482834a11ba4da2929d135f99a366d5af44638 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 6 Nov 2011 15:43:29 +0100 Subject: [PATCH] revert, remove subscribers setting a list to private --- pandora/itemlist/views.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/pandora/itemlist/views.py b/pandora/itemlist/views.py index a8279024e..61a8aaee5 100644 --- a/pandora/itemlist/views.py +++ b/pandora/itemlist/views.py @@ -310,14 +310,14 @@ def editList(request): if value not in list._status: value = list._status[0] if value == 'private': + for user in list.subscribed_users.all(): + list.subscribed_users.remove(user) qs = models.Position.objects.filter(user=request.user, section='section', list=list) if qs.count() > 1: pos = qs[0] pos.section = 'personal' pos.save() - models.Position.objects.filter(list=list, - section='public').delete() elif value == 'featured': if not request.user.is_staff: value = list.status @@ -378,29 +378,6 @@ def editList(request): return render_to_json_response(response) actions.register(editList, cache=False) -@login_required_json -def removeSubscribers(request): - ''' - param data { - list: listId, - } - return { - status: {'code': int, 'text': string}, - data: { - } - } - ''' - data = json.loads(request.POST['data']) - list = get_list_or_404_json(data['list']) - response = json_response() - if list.editable(request.user): - for user in list.subscribed_users.all(): - list.subscribed_users.remove(user) - else: - response = json_response(status=403, text='not allowed') - return render_to_json_response(response) -actions.register(removeSubscribers, cache=False) - @login_required_json def removeList(request): '''