[extensions-web] review: Auto approve all extensions by reviewers
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] review: Auto approve all extensions by reviewers
- Date: Tue, 3 Apr 2012 15:29:58 +0000 (UTC)
commit f1323ed3ab9170a77d2be04813b2819e4dc399a5
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Apr 3 11:29:41 2012 -0400
review: Auto approve all extensions by reviewers
sweettooth/review/views.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/review/views.py b/sweettooth/review/views.py
index c631c18..b4a2696 100644
--- a/sweettooth/review/views.py
+++ b/sweettooth/review/views.py
@@ -368,7 +368,11 @@ def send_email_auto_approved(request, version, changeset):
message = EmailMessage(subject=subject, body=body, to=recipient_list, headers=extra_headers)
message.send()
-def safe_to_auto_approve(changes):
+def safe_to_auto_approve(extension, changes):
+ # If a user can approve extensions, don't bother making him do so.
+ if can_approve_extension(extension.creator, extension):
+ return True
+
for filename in itertools.chain(changes['changed'], changes['added']):
# metadata.json updates are safe.
if filename == 'metadata.json':
@@ -396,7 +400,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(changeset):
+ if safe_to_auto_approve(version.extension, changeset):
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]