diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 360: * fix semantic merge conflict in renaming of get_restricted_object_or_404

Message ID 20121116010214.19125.98587.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Nov. 16, 2012, 1:02 a.m. UTC
------------------------------------------------------------
revno: 360
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Fri 2012-11-16 14:01:22 +1300
message:
  * fix semantic merge conflict in renaming of get_restricted_object_or_404
  * fix stupid bug in importing test result attachments
modified:
  dashboard_app/helpers.py
  dashboard_app/views/__init__.py


--
lp:lava-dashboard
https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk

You are subscribed to branch lp:lava-dashboard.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'dashboard_app/helpers.py'
--- dashboard_app/helpers.py	2012-11-07 03:21:52 +0000
+++ dashboard_app/helpers.py	2012-11-16 01:01:22 +0000
@@ -736,7 +736,7 @@ 
         from dashboard_app.models import TestResult
         super(BundleFormatImporter_1_5, self)._import_test_results(c_test_run, s_test_run)
         for index, c_test_result in enumerate(c_test_run.get("test_results", []), 1):
-            if c_test_result.get("attributes", {}):
+            if c_test_result.get("attachments", {}):
                 s_test_result = TestResult.objects.get(
                     relative_index=index, test_run=s_test_run)
                 self._import_test_result_attachments(c_test_result, s_test_result)

=== modified file 'dashboard_app/views/__init__.py'
--- dashboard_app/views/__init__.py	2012-11-15 17:08:40 +0000
+++ dashboard_app/views/__init__.py	2012-11-16 01:01:22 +0000
@@ -569,7 +569,7 @@ 
     parent=test_result_detail,
     needs=['pathname', 'content_sha1', 'analyzer_assigned_uuid', 'relative_index'])
 def result_attachment_list(request, pathname, content_sha1, analyzer_assigned_uuid, relative_index):
-    test_result = get_restricted_object_or_404(
+    test_result = get_restricted_object(
         TestResult,
         lambda test_result: test_result.test_run.bundle.bundle_stream,
         request.user,
@@ -619,7 +619,7 @@ 
     parent=result_attachment_list,
     needs=['pathname', 'content_sha1', 'analyzer_assigned_uuid', 'relative_index', 'pk'])
 def result_attachment_detail(request, pathname, content_sha1, analyzer_assigned_uuid, relative_index, pk):
-    attachment = get_restricted_object_or_404(
+    attachment = get_restricted_object(
         Attachment,
         lambda attachment: attachment.bundle.bundle_stream,
         request.user,