[extensions-web] Don't re-save metadata.json in places we know it doesn't change



commit d88b1704b609d2bcc722daea327aad6dbe0975bf
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jan 30 12:08:09 2012 -0500

    Don't re-save metadata.json in places we know it doesn't change
    
    All it does is waste disk IO time

 sweettooth/extensions/views.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index bde792c..ab44ae8 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -35,7 +35,7 @@ def shell_download(request, uuid):
         return HttpResponseForbidden()
 
     extension.downloads += 1
-    extension.save()
+    extension.save(replace_metadata_json=False)
 
     return redirect(version.source.url)
 
@@ -280,7 +280,7 @@ def ajax_inline_edit_view(request, obj):
 @model_view(models.Extension)
 def ajax_upload_screenshot_view(request, obj):
     obj.screenshot = request.FILES['file']
-    obj.save()
+    obj.save(replace_metadata_json=False)
     return get_thumbnail(obj.screenshot, request.GET['geometry']).url
 
 @ajax_view
@@ -288,7 +288,7 @@ def ajax_upload_screenshot_view(request, obj):
 @model_view(models.Extension)
 def ajax_upload_icon_view(request, obj):
     obj.icon = request.FILES['file']
-    obj.save()
+    obj.save(replace_metadata_json=False)
     return obj.icon.url
 
 def ajax_details(extension):



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