[extensions-web] review: Remove the auto reject system
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] review: Remove the auto reject system
- Date: Mon, 6 Aug 2012 21:27:21 +0000 (UTC)
commit 01894283d3952de3d3e4cb56d1d040fb79ec418b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Aug 6 15:34:28 2012 -0300
review: Remove the auto reject system
sweettooth/review/tests.py | 41 +----------------------------------------
sweettooth/review/views.py | 24 ------------------------
2 files changed, 1 insertions(+), 64 deletions(-)
---
diff --git a/sweettooth/review/tests.py b/sweettooth/review/tests.py
index 5758a51..ef25a89 100644
--- a/sweettooth/review/tests.py
+++ b/sweettooth/review/tests.py
@@ -3,7 +3,7 @@ from django.test import TestCase
from django.core.files.base import File, ContentFile, StringIO
from extensions import models
-from review.views import get_old_version, should_auto_approve, should_auto_reject
+from review.views import get_old_version, should_auto_approve
from testutils import BasicUserTestCase
@@ -46,42 +46,3 @@ class TestAutoApproveLogic(TestCase):
self.assertFalse(should_auto_approve(self.build_changeset(changed=['secret_keys.json'])))
self.assertFalse(should_auto_approve(self.build_changeset(changed=['libbignumber/BigInteger.js'])))
self.assertFalse(should_auto_approve(self.build_changeset(added=['libbignumber/BigInteger.js'])))
-
-class TestAutoReject(BasicUserTestCase, TestCase):
- def test_shell_version_auto_reject(self):
- metadata = {"name": "Test Metadata 10",
- "uuid": "test-10 mecheye net",
- "description": "Simple test metadata",
- "url": "http://test-metadata.gnome.org"}
-
- extension = models.Extension.objects.create_from_metadata(metadata, creator=self.user)
- version1 = models.ExtensionVersion.objects.create(extension=extension, status=models.STATUS_UNREVIEWED)
- version1.parse_metadata_json({'shell-version': ["3.4", "3.2.1"]})
-
- version2 = models.ExtensionVersion.objects.create(extension=extension, status=models.STATUS_UNREVIEWED)
-
- version2.parse_metadata_json({'shell-version': ["3.4"]})
- self.assertFalse(should_auto_reject(version1, version2))
-
- version2.parse_metadata_json({'shell-version': ["3.2.1"]})
- self.assertTrue(should_auto_reject(version1, version2))
-
- # As this safely covers all of version 1's shell versions,
- # it should be rejected
- version2.parse_metadata_json({'shell-version': ["3.6"]})
- self.assertTrue(should_auto_reject(version1, version2))
-
- def test_existing_version_auto_reject(self):
- metadata = {"name": "Test Metadata 11",
- "uuid": "test-11 mecheye net",
- "description": "Simple test metadata",
- "url": "http://test-metadata.gnome.org"}
-
- extension = models.Extension.objects.create_from_metadata(metadata, creator=self.user)
- version1 = models.ExtensionVersion.objects.create(extension=extension, status=models.STATUS_ACTIVE)
- version1.parse_metadata_json({'shell-version': ["3.4", "3.2.1"]})
-
- version2 = models.ExtensionVersion.objects.create(extension=extension, status=models.STATUS_UNREVIEWED)
- version2.parse_metadata_json({'shell-version': ["3.4", "3.2.1"]})
-
- self.assertFalse(should_auto_reject(version1, version2))
diff --git a/sweettooth/review/views.py b/sweettooth/review/views.py
index 3c6ebc4..3d5d1be 100644
--- a/sweettooth/review/views.py
+++ b/sweettooth/review/views.py
@@ -373,17 +373,6 @@ def should_auto_approve(changes, extension=None):
return True
-def should_auto_reject(old_version, new_version):
- if old_version is None:
- return False
-
- if old_version.status != models.STATUS_UNREVIEWED:
- return False
-
- old_svs = set(old_version.shell_versions.all())
- new_svs = set(new_version.shell_versions.all())
- return new_svs.issuperset(old_svs)
-
def extension_submitted(sender, request, version, **kwargs):
old_version = version.extension.latest_version
old_zipfile, new_zipfile = get_zipfiles(old_version, version)
@@ -403,19 +392,6 @@ def extension_submitted(sender, request, version, **kwargs):
send_email_auto_approved(request, version, changeset)
return
- if should_auto_reject(old_version, version):
- log = ChangeStatusLog.objects.create(user=request.user,
- version=old_version,
- newstatus=models.STATUS_REJECTED,
- auto=True)
- CodeReview.objects.create(version=old_version,
- reviewer=request.user,
- comments="",
- changelog=log)
- old_version.status = models.STATUS_REJECTED
- old_version.save()
- version.save()
-
send_email_submitted(request, version)
models.submitted_for_review.connect(extension_submitted)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]