sharingan-no-kakashi commented on a change in pull request #16953:
URL: https://github.com/apache/airflow/pull/16953#discussion_r670469213
##########
File path: airflow/www/views.py
##########
@@ -1354,6 +1356,82 @@ def xcom(self, session=None):
title=title,
)
+ @expose('/task_note', methods=['POST', 'GET'])
+ @auth.has_access(
+ [
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG),
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE),
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_NOTE),
+ ]
+ )
+ @action_logging
+ @provide_session
+ def task_note(self, session=None):
+ """Retrieve and store task notes"""
+ dag_id = request.args.get('dag_id')
+ task_id = request.args.get('task_id')
+ execution_date = request.args.get('execution_date')
+ dttm = timezone.parse(execution_date)
+ form = DateTimeForm(data={'execution_date': dttm})
+ root = request.args.get('root', '')
+ dm_db = models.DagModel
+ ti_db = models.TaskInstance
+ request_note = request.values.get('note')
+ default_user = "Anonymous"
+ title = "Notes"
+
+ dag = session.query(dm_db).filter(dm_db.dag_id == dag_id).first()
Review comment:
Yes, it's used in the jinja templating. The task note view extends the
task instance view and it needs the dag
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]