[extensions-web] review: Add a comment for auto-approved extensions
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] review: Add a comment for auto-approved extensions
- Date: Sat, 7 Apr 2012 19:22:10 +0000 (UTC)
commit fd62b148a7e462bb395cb2ea87e51dcee7160b06
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sat Apr 7 16:21:55 2012 -0300
review: Add a comment for auto-approved extensions
sweettooth/review/templates/review/review.html | 5 ++++-
sweettooth/review/views.py | 12 ++++++++----
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/sweettooth/review/templates/review/review.html b/sweettooth/review/templates/review/review.html
index 4c3bdb2..5f589d4 100644
--- a/sweettooth/review/templates/review/review.html
+++ b/sweettooth/review/templates/review/review.html
@@ -91,7 +91,10 @@
<div class="review">
<a class="review-author" href="{% url auth-profile user=review.reviewer.username %}">{{ review.reviewer }}</a>
{% if review.changelog %}
- <span class="{{ review.changelog.get_newstatus_class }}">{{ review.changelog.get_newstatus_display|lower }}</span>
+ <span class="{{ review.changelog.get_newstatus_class }}">
+ {% if review.changelog.auto_approved %}auto-{% endif%}
+ {{ review.changelog.get_newstatus_display|lower }}
+ </span>
{% else %}
posted a review
{% endif %}
diff --git a/sweettooth/review/views.py b/sweettooth/review/views.py
index 5344d56..3353bed 100644
--- a/sweettooth/review/views.py
+++ b/sweettooth/review/views.py
@@ -400,10 +400,14 @@ def extension_submitted(sender, request, version, **kwargs):
changeset = get_file_changeset(old_zipfile, new_zipfile)
if safe_to_auto_approve(changeset, extension=version.extension):
- ChangeStatusLog.objects.create(user=request.user,
- version=version,
- newstatus=models.STATUS_ACTIVE,
- auto_approved=True)
+ log = ChangeStatusLog.objects.create(user=request.user,
+ version=version,
+ newstatus=models.STATUS_ACTIVE,
+ auto_approved=True)
+ CodeReview.objects.create(version=version,
+ reviewer=request.user,
+ comments="",
+ changelog=log)
version.status = models.STATUS_ACTIVE
version.save()
send_email_auto_approved(request, version, changeset)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]