Merge pull request #3516 from mozilla/remove-migrate-editor-eventlog-task

Remove unused migrate_editor_eventlog task.
This commit is contained in:
Christopher Grebs 2016-09-15 13:12:38 +02:00 коммит произвёл GitHub
Родитель edb5d44b59 e66c8eb1b7
Коммит ec798bb335
2 изменённых файлов: 0 добавлений и 26 удалений

Просмотреть файл

@ -3,15 +3,12 @@ import datetime
from django.core.mail import EmailMessage, EmailMultiAlternatives
import commonware.log
import phpserialize
from olympia import amo
from olympia.amo.celery import task
from olympia.amo.utils import get_email_backend
from olympia.bandwagon.models import Collection
from olympia.devhub.models import ActivityLog
from olympia.editors.models import EventLog
from olympia.reviews.models import Review
from olympia.stats.models import Contribution
@ -78,25 +75,3 @@ def delete_anonymous_collections(items, **kw):
(len(items), delete_anonymous_collections.rate_limit))
Collection.objects.filter(type=amo.COLLECTION_ANONYMOUS,
pk__in=items).delete()
@task
def migrate_editor_eventlog(items, **kw):
log.info('[%s@%s] Migrating eventlog items' %
(len(items), migrate_editor_eventlog.rate_limit))
for item in EventLog.objects.filter(pk__in=items):
kw = dict(user=item.user, created=item.created)
if item.action == 'review_delete':
details = None
try:
details = phpserialize.loads(item.notes)
except ValueError:
pass
amo.log(amo.LOG.DELETE_REVIEW, item.changed_id, details=details,
**kw)
elif item.action == 'review_approve':
try:
r = Review.objects.get(pk=item.changed_id)
amo.log(amo.LOG.ADD_REVIEW, r, r.addon, **kw)
except Review.DoesNotExist:
log.warning("Couldn't find review for %d" % item.changed_id)

Просмотреть файл

@ -1112,7 +1112,6 @@ CELERY_ROUTES = {
'olympia.amo.tasks.delete_anonymous_collections': {'queue': 'amo'},
'olympia.amo.tasks.delete_logs': {'queue': 'amo'},
'olympia.amo.tasks.delete_stale_contributions': {'queue': 'amo'},
'olympia.amo.tasks.migrate_editor_eventlog': {'queue': 'amo'},
'olympia.amo.tasks.send_email': {'queue': 'amo'},
'olympia.amo.tasks.set_modified_on_object': {'queue': 'amo'},