Delete write_creator because it is done. (#2134)
This commit is contained in:
Родитель
b3e16e5fb2
Коммит
547e77515a
|
@ -14,9 +14,6 @@ cron:
|
|||
- description: Trigger a DataStore export for backup.
|
||||
url: /cron/export_backup
|
||||
schedule: every day 03:00
|
||||
- description: Writes string creator field from created_by user field.
|
||||
url: /cron/write_creator
|
||||
schedule: 1 of month 03:00
|
||||
- description: Send reminders to verify the accuracy of feature data.
|
||||
url: /cron/send_accuracy_notifications
|
||||
schedule: every monday 09:00
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
import logging
|
||||
|
||||
from framework.basehandlers import FlaskHandler
|
||||
from internals.models import Feature
|
||||
|
||||
|
||||
class UpdateCreatorHandler(FlaskHandler):
|
||||
|
||||
def get_template_data(self):
|
||||
"""Writes string creator field from created_by user field."""
|
||||
q = Feature.query()
|
||||
features = q.fetch()
|
||||
update_count = 0
|
||||
for feature in features:
|
||||
logging.info(f'considering {feature.name}.')
|
||||
if feature.created_by and not feature.creator:
|
||||
update_count += 1
|
||||
email = "Unknown"
|
||||
if feature.created_by:
|
||||
email = feature.created_by.email()
|
||||
feature.creator = email
|
||||
logging.info(f'updating {feature.name}.')
|
||||
feature.put(notify=False)
|
||||
|
||||
logging.info(f'{update_count} features updated with new creator field.')
|
||||
return 'Success'
|
2
main.py
2
main.py
|
@ -35,7 +35,6 @@ from internals import detect_intent
|
|||
from internals import fetchmetrics
|
||||
from internals import notifier
|
||||
from internals import data_backup
|
||||
from internals import write_creator
|
||||
from pages import blink_handler
|
||||
from pages import featuredetail
|
||||
from pages import featurelist
|
||||
|
@ -199,7 +198,6 @@ internals_routes = [
|
|||
('/cron/histograms', fetchmetrics.HistogramsHandler),
|
||||
('/cron/update_blink_components', fetchmetrics.BlinkComponentHandler),
|
||||
('/cron/export_backup', data_backup.BackupExportHandler),
|
||||
('/cron/write_creator', write_creator.UpdateCreatorHandler),
|
||||
('/cron/send_accuracy_notifications', notifier.FeatureAccuracyHandler),
|
||||
|
||||
('/tasks/email-subscribers', notifier.FeatureChangeHandler),
|
||||
|
|
Загрузка…
Ссылка в новой задаче