Commits

Anonymous committed 8dbaa57

make signoff work against av instead of ms (it takes the latest MS when opening pushes for now)

  • Participants
  • Parent commits 6940e81

Comments (0)

Files changed (2)

File signoff/templates/signoff/dashboard.html

 {% block extra_labels %}, Sign-off{% endblock %}
 {% block extra_columns %}, .locale.signoff{% endblock %}
 {% block extra_cells %}<td>
-  <a ex:href-subcontent="{% url signoff.views.pushes %}?locale={&#123;.locale}}&ms={{obj.code}}">
+  <a ex:href-subcontent="{% url signoff.views.pushes %}?locale={&#123;.locale}}&av={{obj.code}}">
     <span ex:if="exists( .locale.signoff )">
       <span ex:content=".locale.signoff"></span>
       <span>no sign-offs</span>

File signoff/views.py

     })
 
 def pushes(request):
-    if request.GET['locale']:
+    if request.GET.has_key('locale'):
         locale = Locale.objects.get(code=request.GET['locale'])
-    if request.GET['ms']:
+    if request.GET.has_key('ms'):
         mstone = Milestone.objects.get(code=request.GET['ms'])
+    if request.GET.has_key('av'):
+        av = AppVersion.objects.get(code=request.GET['av'])
+        mstone = Milestone.objects.filter(appver=av.id).order_by('-pk')[0]
     enabled = mstone.status<2
     if enabled:
         current = _get_current_signoff(locale, mstone)
     if request.GET.has_key('ms'):
         mstone = Milestone.objects.get(code=request.GET['ms'])
         sos = _get_signoffs(ms=mstone, status=None)
-    elif request.GET.has_key('appver'):
-        appver = AppVersion.objects.get(code=request.GET['appver'])
+    elif request.GET.has_key('av'):
+        appver = AppVersion.objects.get(code=request.GET['av'])
         sos = _get_signoffs(av=appver, status=None)
     items = defaultdict(set)
     values = dict(Action._meta.get_field('flag').flatchoices)