[extensions-web: 17/30] Use POST for the popularity tracking



commit ab25f5acb2dd9a4ffae1bc6bee7d6459a190b917
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Dec 28 01:41:42 2011 -0500

    Use POST for the popularity tracking
    
    Conflicts:
    
    	sweettooth/extensions/views.py

 sweettooth/extensions/views.py     |    5 +++--
 sweettooth/static/js/extensions.js |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index 8c2ed41..b97da02 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -218,10 +218,11 @@ def extension_version_view(request, obj, **kwargs):
         context['old_version'] = version.version < extension.latest_version.version
     return render(request, template_name, context)
 
+ require_POST
 @ajax_view
 def ajax_adjust_popularity_view(request):
-    uuid = request.GET['uuid']
-    action = request.GET['action']
+    uuid = request.POST['uuid']
+    action = request.POST['action']
 
     extension = models.Extension.objects.get(uuid=uuid)
     pop = models.ExtensionPopularityItem(extension=extension)
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index 540827d..dc41570 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -118,6 +118,7 @@ function($, messages, dbusProxy, extensionUtils) {
 
         function sendPopularity(action) {
             $.ajax({ url: '/ajax/adjust-popularity/',
+                     type: 'POST',
                      data: { uuid: uuid,
                              action: action } });
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]