[extensions-web] review: Fix tests
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] review: Fix tests
- Date: Tue, 3 Apr 2012 15:54:36 +0000 (UTC)
commit ae348d91734dd218b0fa9d8f1ad4a626d8445d9c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Apr 3 11:43:30 2012 -0400
review: Fix tests
sweettooth/review/views.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/sweettooth/review/views.py b/sweettooth/review/views.py
index 5cd37ad..b20f85d 100644
--- a/sweettooth/review/views.py
+++ b/sweettooth/review/views.py
@@ -363,9 +363,9 @@ def send_email_auto_approved(request, version, changeset):
'X-SweetTooth-ExtensionCreator': extension.creator.username})
message.send()
-def safe_to_auto_approve(extension, changes):
+def safe_to_auto_approve(changes, extension=None):
# If a user can approve extensions, don't bother making him do so.
- if can_approve_extension(extension.creator, extension):
+ if extension is not None and can_approve_extension(extension.creator, extension):
return True
for filename in itertools.chain(changes['changed'], changes['added']):
@@ -395,7 +395,7 @@ def extension_submitted(sender, request, version, **kwargs):
old_zipfile, new_zipfile = get_zipfiles(get_latest_active_version(version), version)
changeset = get_file_changeset(old_zipfile, new_zipfile)
- if safe_to_auto_approve(version.extension, changeset):
+ if safe_to_auto_approve(changeset, extension=version.extension):
ChangeStatusLog.objects.create(user=request.user,
version=version,
newstatus=models.STATUS_ACTIVE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]