ashb commented on a change in pull request #5525: [AIRFLOW-4890] Fix Log link 
in TaskInstance's View for Non-RBAC
URL: https://github.com/apache/airflow/pull/5525#discussion_r300026819
 
 

 ##########
 File path: airflow/models/taskinstance.py
 ##########
 @@ -374,14 +375,12 @@ def log_filepath(self):
 
     @property
     def log_url(self):
-        iso = quote(self.execution_date.isoformat())
-        base_url = configuration.conf.get('webserver', 'BASE_URL')
-        return base_url + (
-            "/log?"
-            "execution_date={iso}"
-            "&task_id={task_id}"
-            "&dag_id={dag_id}"
-        ).format(iso=iso, task_id=self.task_id, dag_id=self.dag_id)
+        url = url_for(
 
 Review comment:
   I'm not sure I like it, but:
   
   ```python
   if not flask._request_ctx_stack:
       with request_context(... MESSY_ARGS ... ):
          return url_for(...)
   else:
       return url_for(...)
   ```
   
   Also actually making the args to work for `request_context()` may be hard 
(not to mention messy in a model.)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to