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

Commit

Permalink
Fixed "review_viewing" on mkt
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson committed Jul 27, 2012
1 parent 967b3bf commit f5d386e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion media/js/zamboni/editors.js
Expand Up @@ -129,8 +129,9 @@ function initReviewActions() {

/* Who's currently on this page? */
var addon_id = $('#addon').attr('data-id');
var url = $('#addon').attr('data-url');
function check_currently_viewing() {
$.post('/en-US/editors/review_viewing', {'addon_id': addon_id}, function(d){
$.post(url, {'addon_id': addon_id}, function(d){
var show = d.is_user != 1 && typeof d.current_name != "undefined",
$current = $('.currently_viewing_warning');

Expand Down
2 changes: 1 addition & 1 deletion mkt/reviewers/templates/reviewers/review.html
Expand Up @@ -47,7 +47,7 @@ <h1 class="addon"{{ product.name|locale_html }}>
</div>
</div>

<div id="addon" data-id="{{ product.id }}">
<div id="addon" data-id="{{ product.id }}" data-url="{{ url('editors.review_viewing') }}">

<section class="island">
{% include 'reviewers/includes/details.html' %}
Expand Down
8 changes: 8 additions & 0 deletions mkt/reviewers/tests/test_views.py
Expand Up @@ -165,6 +165,10 @@ def setUp(self):
def review_url(self, app):
return urlparams(reverse('reviewers.apps.review', args=[app.app_slug]))

def test_queue_viewing_ping(self):
eq_(self.client.post(reverse('editors.queue_viewing')).status_code,
200)

def test_template_links(self):
r = self.client.get(self.url)
eq_(r.status_code, 200)
Expand Down Expand Up @@ -528,6 +532,10 @@ def post(self, data, queue='pending'):
# Purposefully not using assertRedirects.
self.assert3xx(res, reverse('reviewers.apps.queue_%s' % queue))

def test_review_viewing_ping(self):
eq_(self.client.post(reverse('editors.review_viewing')).status_code,
200)

@mock.patch.object(settings, 'DEBUG', False)
def test_cannot_review_my_app(self):
AddonUser.objects.create(addon=self.app,
Expand Down
3 changes: 2 additions & 1 deletion mkt/reviewers/urls.py
@@ -1,7 +1,7 @@
from django.conf.urls.defaults import include, url

import amo
from apps.editors.views import queue_viewing
from apps.editors.views import queue_viewing, review_viewing

This comment has been minimized.

Copy link
@cvan

cvan Aug 10, 2012

Contributor

this is not order alphabetical

This comment has been minimized.

Copy link
@robhudson

robhudson Aug 10, 2012

Author Member

in which universe?

from mkt.receipts.urls import receipt_patterns
from . import views

Expand All @@ -26,6 +26,7 @@
url(r'^apps/logs$', views.logs, name='reviewers.apps.logs'),
url(r'^apps/motd$', views.motd, name='reviewers.apps.motd'),
url(r'^queue_viewing$', queue_viewing, name='editors.queue_viewing'),
url(r'^review_viewing$', review_viewing, name='editors.review_viewing'),

url(r'^receipt/', include(receipt_patterns))
)

0 comments on commit f5d386e

Please sign in to comment.