too many logs written (bug 636397, comment #5)
This commit is contained in:
Родитель
37447997b1
Коммит
b36f1ff93b
|
@ -261,10 +261,6 @@ class ReviewBase:
|
|||
file.status = status
|
||||
file.save()
|
||||
|
||||
def log_status(self):
|
||||
amo.log(amo.LOG.CHANGE_STATUS, self.addon, self.addon.status,
|
||||
user=self.user.get_profile())
|
||||
|
||||
def log_approval(self, action):
|
||||
amo.log(action, self.addon, self.version, user=self.user.get_profile(),
|
||||
created=datetime.now(),
|
||||
|
@ -319,7 +315,6 @@ class ReviewAddon(ReviewBase):
|
|||
self.set_files(amo.STATUS_PUBLIC, self.version.files.all(),
|
||||
copy_to_mirror=True)
|
||||
|
||||
self.log_status()
|
||||
self.log_approval(amo.LOG.APPROVE_VERSION)
|
||||
self.notify_email('%s_to_public' % self.review_type,
|
||||
_('Mozilla Add-ons: %s %s Fully Reviewed'))
|
||||
|
@ -333,7 +328,6 @@ class ReviewAddon(ReviewBase):
|
|||
self.set_files(amo.STATUS_DISABLED, self.version.files.all(),
|
||||
hide_disabled_file=True)
|
||||
|
||||
self.log_status()
|
||||
self.log_approval(amo.LOG.REJECT_VERSION)
|
||||
self.notify_email('%s_to_sandbox' % self.review_type,
|
||||
# L10n: addon name, version string
|
||||
|
@ -358,7 +352,6 @@ class ReviewAddon(ReviewBase):
|
|||
self.set_files(amo.STATUS_LITE, self.version.files.all(),
|
||||
copy_to_mirror=True)
|
||||
|
||||
self.log_status()
|
||||
self.log_approval(amo.LOG.PRELIMINARY_VERSION)
|
||||
self.notify_email(template,
|
||||
# L10n: addon name, version string
|
||||
|
|
|
@ -275,13 +275,8 @@ class TestReviewHelper(test_utils.TestCase):
|
|||
|
||||
def test_logs(self):
|
||||
self.helper.set_data({'comments': 'something'})
|
||||
self.helper.handler.log_status()
|
||||
self.helper.handler.log_approval(amo.LOG.APPROVE_VERSION)
|
||||
|
||||
log = ActivityLog.objects.for_addons(self.helper.addon)
|
||||
eq_(len(log), 2)
|
||||
ids = set([l.action for l in log])
|
||||
eq_(ids, set([amo.LOG.CHANGE_STATUS.id, amo.LOG.APPROVE_VERSION.id]))
|
||||
eq_(self.check_log_count(amo.LOG.APPROVE_VERSION.id), 1)
|
||||
|
||||
def test_notify_email(self):
|
||||
self.helper.set_data(self.get_data())
|
||||
|
@ -337,11 +332,7 @@ class TestReviewHelper(test_utils.TestCase):
|
|||
|
||||
assert os.path.exists(self.file.mirror_file_path)
|
||||
|
||||
log = ActivityLog.objects.for_addons(self.helper.addon)
|
||||
eq_(len(log), 2)
|
||||
ids = set([l.action for l in log])
|
||||
eq_(ids, set([amo.LOG.CHANGE_STATUS.id,
|
||||
amo.LOG.APPROVE_VERSION.id]))
|
||||
eq_(self.check_log_count(amo.LOG.APPROVE_VERSION.id), 1)
|
||||
|
||||
def test_nomination_to_preliminary(self):
|
||||
for status in NOMINATED_STATUSES:
|
||||
|
@ -360,7 +351,6 @@ class TestReviewHelper(test_utils.TestCase):
|
|||
|
||||
assert os.path.exists(self.file.mirror_file_path)
|
||||
|
||||
eq_(self.check_log_count(amo.LOG.CHANGE_STATUS.id), 1)
|
||||
eq_(self.check_log_count(amo.LOG.PRELIMINARY_VERSION.id), 1)
|
||||
|
||||
def test_nomination_to_sandbox(self):
|
||||
|
@ -377,7 +367,6 @@ class TestReviewHelper(test_utils.TestCase):
|
|||
eq_(mail.outbox[0].subject, '%s Reviewed' % self.preamble)
|
||||
|
||||
assert not os.path.exists(self.file.mirror_file_path)
|
||||
eq_(self.check_log_count(amo.LOG.CHANGE_STATUS.id), 1)
|
||||
eq_(self.check_log_count(amo.LOG.REJECT_VERSION.id), 1)
|
||||
|
||||
def test_nomination_to_super_review(self):
|
||||
|
|
Загрузка…
Ссылка в новой задаче