Minor display bug around filepath
This commit is contained in:
Родитель
58cab7664e
Коммит
835b744b26
|
@ -982,8 +982,8 @@ class DAG(Base):
|
|||
|
||||
@property
|
||||
def filepath(self):
|
||||
return self.full_filepath.replace(
|
||||
getconf().get('core', 'AIRFLOW_HOME') + '/', '')
|
||||
base = getconf().get('core', 'DAGS_FOLDER')
|
||||
return self.full_filepath.replace(base + '/', '')
|
||||
|
||||
@property
|
||||
def folder(self):
|
||||
|
|
|
@ -113,7 +113,7 @@ class Airflow(BaseView):
|
|||
def code(self):
|
||||
dag_id = request.args.get('dag_id')
|
||||
dag = dagbag.dags[dag_id]
|
||||
code = "".join(open(dag.filepath, 'r').readlines())
|
||||
code = "".join(open(dag.full_filepath, 'r').readlines())
|
||||
title = dag.filepath.replace(getconf().get('core', 'BASE_FOLDER') + '/dags/', '')
|
||||
html_code = highlight(
|
||||
code, PythonLexer(), HtmlFormatter(noclasses=True))
|
||||
|
|
Загрузка…
Ссылка в новой задаче