From 362d124937409d95065d19acbd2575490d701a89 Mon Sep 17 00:00:00 2001 From: lukebarnard Date: Thu, 21 May 2015 15:17:58 +0200 Subject: [PATCH] Fixed deletion of content and links Sometimes this can give power to users to delete entire conversations, so maybe LINK removal is something that should not be possible. People should however be able to hide their content through some other method. --- server/o2m/basic_client/templates/timeline.html | 2 +- server/o2m/basic_client/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/o2m/basic_client/templates/timeline.html b/server/o2m/basic_client/templates/timeline.html index 49ec2b2..045b82d 100644 --- a/server/o2m/basic_client/templates/timeline.html +++ b/server/o2m/basic_client/templates/timeline.html @@ -45,7 +45,7 @@

{{friend.name}}

{% csrf_token %} - + diff --git a/server/o2m/basic_client/views.py b/server/o2m/basic_client/views.py index b4704a6..6d22142 100644 --- a/server/o2m/basic_client/views.py +++ b/server/o2m/basic_client/views.py @@ -126,6 +126,7 @@ def assign_links_address(links): for link in links: link['address'] = friend.address link['port'] = friend.port + link['link_friend'] = friend if len(link['children']): assign_links_address(link['children']) return links @@ -255,7 +256,7 @@ def add_content(request): def delete_content(request): """Deletes content from the server belonging to 'me' """ - me = Friend.objects.get(name=o2m.settings.ME) + me = Friend.objects.get(name=request.user.username) content_id = request.POST['content_id'] resp = get_from_friend('/content/{0}'.format(content_id), me, me, method = 'DELETE')