Skip to content

Commit

Permalink
Bumps nomination date when author re-nominates addon for review (bug …
Browse files Browse the repository at this point in the history
…626452)
  • Loading branch information
kumar303 committed Feb 4, 2011
1 parent 67c5f93 commit 6d6016f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/addons/models.py
Expand Up @@ -884,7 +884,7 @@ def watch_status(sender, instance, **kw):
return
addon = instance
stati = (amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED)
if addon.status in stati and addon.nomination_date is None:
if addon.status in stati:
addon.nomination_date = datetime.now()
dbsignals.pre_save.connect(watch_status, sender=Addon)

Expand Down
11 changes: 10 additions & 1 deletion apps/devhub/tests/test_views.py
Expand Up @@ -5,7 +5,7 @@
import shutil
import socket
import tempfile
from datetime import datetime
from datetime import datetime, timedelta
from decimal import Decimal

from django import forms
Expand Down Expand Up @@ -4008,6 +4008,15 @@ def test_lite_and_nominated(self):
self.check_400(self.lite_url)
self.check_400(self.public_url)

def test_renominate_for_full_review(self):
# When a version is rejected, the addon is disabled.
# The author must upload a new version and re-nominate.
self.addon.update(
# Pretend it was nominated in the past:
nomination_date=datetime.now() - timedelta(days=30))
self.check(amo.STATUS_NULL, self.public_url, amo.STATUS_NOMINATED)
assert_close_to_now(self.get_addon().nomination_date)


class TestRedirects(test_utils.TestCase):
fixtures = ['base/apps', 'base/users', 'base/addon_3615']
Expand Down

0 comments on commit 6d6016f

Please sign in to comment.