[extensions-web] Use the PK for the extension download



commit 1dbf134ee3f7954eb7236f9e41816010a9508bb2
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sat Nov 19 17:01:00 2011 -0500

    Use the PK for the extension download
    
    It's easier to build a zipfile link for

 sweettooth/review/urls.py  |    2 +-
 sweettooth/review/views.py |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/sweettooth/review/urls.py b/sweettooth/review/urls.py
index ca38823..047ac13 100644
--- a/sweettooth/review/urls.py
+++ b/sweettooth/review/urls.py
@@ -15,7 +15,7 @@ urlpatterns = patterns('',
     url(r'^ajax/get-file-diff/(?P<pk>\d+)', views.ajax_get_file_diff_view, name='review-ajax-file-diff'),
     url(r'^submit/(?P<pk>\d+)', views.submit_review_view, name='review-submit'),
 
-    url(r'^download/(?P<uuid>.+)\.shell-extension\.zip$',
+    url(r'^download/(?P<pk>)\.shell-extension.zip$',
         views.download_zipfile, name='review-download'),
 
     url(r'^(?P<pk>\d+)', views.review_version_view, name='review-version'),
diff --git a/sweettooth/review/views.py b/sweettooth/review/views.py
index 78106d8..f9b73cf 100644
--- a/sweettooth/review/views.py
+++ b/sweettooth/review/views.py
@@ -206,8 +206,7 @@ def ajax_get_file_view(request, obj):
     raw = f.read()
     return html_for_file(filename, obj, raw)
 
-def download_zipfile(request, uuid):
-    pk = request.GET['pk']
+def download_zipfile(request, pk):
     version = get_object_or_404(models.ExtensionVersion, pk=pk)
 
     if version.extension.uuid != uuid:



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