Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/2012-06-13'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pike committed Jun 13, 2012
2 parents f4eed89 + 8002810 commit 21878d4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions apps/shipping/api.py
Expand Up @@ -248,7 +248,7 @@ def wrapup(self, push=None, cs=None):
self._prev = push.id


def annotated_pushes(appver, loc, actions, flags, count=10):
def annotated_pushes(appver, loc, actions, flags, fallback, count=10):
pushes_q = (Push.objects
.filter(changesets__branch__id=1)
.order_by('-push_date'))
Expand Down Expand Up @@ -293,7 +293,9 @@ def annotated_pushes(appver, loc, actions, flags, count=10):
initial_diff.append(action4id[flags[Action.PENDING]].signoff_id)
if Action.REJECTED in flags and len(initial_diff) < 2:
initial_diff.append(action4id[flags[Action.REJECTED]].signoff_id)
if current_so is not None:
# if we're having a sign-off on this appversion, i.e no fallback,
# show only new pushes
if current_so is not None and fallback is None:
pushes_q = (pushes_q
.filter(push_date__gte=current_so.push.push_date)
.distinct())
Expand Down
2 changes: 1 addition & 1 deletion apps/shipping/templates/shipping/signoffs.html
Expand Up @@ -44,7 +44,7 @@
<h1>Sign-offs for {{appver}} in {{language}}</h1>
<p>{% if not appver.accepts_signoffs %}{{appver}} is not open for new sign-offs. It's either too early or too late
to do that.{% endif %}
{% if accepted %}There is {% if fallback %}an {{ real_av }} <a href="#{{fallback.tip.shortrev}}">fallback
{% if accepted %}There is {% if fallback %}a {{ real_av }} <a href="#{{fallback.tip.shortrev}}">fallback
signoff</a>{% else %}a <a href="#{{accepted.tip.shortrev}}">current accepted sign-off</a>{% endif %},
which is used for shipping {{appver}}.{% endif %}
{% if pending %}There is a <a href="#{{pending.tip.shortrev}}">pending
Expand Down
3 changes: 2 additions & 1 deletion apps/shipping/tests/test_signoff.py
Expand Up @@ -156,7 +156,8 @@ def test_signoff_static_files(self):
eq_(response.status_code, 200)
self.assert_all_embeds(response.content)

def test_signoff_etag(self):
# XXX bug 763214, disable etag and test for now
def _do_not_test_signoff_etag(self):
"""Test that the ETag is sent correctly for the signoff() view.
Copied here from the etag_signoff() function's doc string:
Expand Down
3 changes: 2 additions & 1 deletion apps/shipping/views/signoff.py
Expand Up @@ -65,6 +65,7 @@ def get_id_or_null(q):
return "%d|%d|%d|%d|%d" % ((can_signoff, review_signoff) + ids)


# XXX bug 763214, disable etag and test for now
#@cache.cache_control(private=True)
#@etag(etag_signoff)
def signoff(request, locale_code, app_code):
Expand Down Expand Up @@ -92,12 +93,12 @@ def signoff(request, locale_code, app_code):
rejected = push4action.get(flags.get(Action.REJECTED))
accepted = push4action.get(flags.get(Action.ACCEPTED))

pushes, suggested_signoff = annotated_pushes(appver, lang, actions, flags)
if real_av != appver.code and accepted is not None:
# we're falling back, add the accepted push to the table
fallback = accepted
else:
fallback = None
pushes, suggested_signoff = annotated_pushes(appver, lang, actions, flags, fallback)

return render(request, 'shipping/signoffs.html', {
'appver': appver,
Expand Down

0 comments on commit 21878d4

Please sign in to comment.