[extensions-web] review: Clean up
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] review: Clean up
- Date: Tue, 26 Jun 2012 20:23:09 +0000 (UTC)
commit 5c1e0c69a2be41a6739b97e15814b9d3d3997309
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jun 26 10:57:52 2012 -0400
review: Clean up
As this is triggered on extension submit, the submitted version
is *always* less than the actual version, thus, it's a simple
line of code to replace.
sweettooth/review/views.py | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
---
diff --git a/sweettooth/review/views.py b/sweettooth/review/views.py
index d799f82..ada4143 100644
--- a/sweettooth/review/views.py
+++ b/sweettooth/review/views.py
@@ -104,16 +104,6 @@ def get_old_version(version):
return old_version
-def get_latest_active_version(version):
- extension = version.extension
-
- try:
- old_version = extension.versions.filter(version__lt=version.version, status=models.STATUS_ACTIVE).latest()
- except models.ExtensionVersion.DoesNotExist:
- return None
-
- return old_version
-
def get_zipfiles(*args):
for version in args:
if version is None:
@@ -408,7 +398,7 @@ def should_auto_reject(old_version, new_version):
return new_svs.issuperset(old_svs)
def extension_submitted(sender, request, version, **kwargs):
- old_version = get_latest_active_version(version)
+ old_version = version.extension.latest_version
old_zipfile, new_zipfile = get_zipfiles(old_version, version)
changeset = get_file_changeset(old_zipfile, new_zipfile)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]