Skip to content

Commit caf1f26

Browse files
committed
[AIRFLOW-5634] Don't allow editing of DagModelView (#6308)
Most/all of these fields are not fur user editing, with the exception of Pause which is set in other ways, and if a user edits these it will just confuse the system. So lets disable the FAB edit form. (Not to mention that the form was broken because it didn't accept the last_scheduler_run as filled out.) (cherry picked from commit c082065)
1 parent aa26dba commit caf1f26

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

airflow/www_rbac/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2601,7 +2601,7 @@ class DagModelView(AirflowModelView):
26012601

26022602
datamodel = AirflowModelView.CustomSQLAInterface(models.DagModel)
26032603

2604-
base_permissions = ['can_list', 'can_show', 'can_edit']
2604+
base_permissions = ['can_list', 'can_show']
26052605

26062606
list_columns = ['dag_id', 'is_paused', 'last_scheduler_run',
26072607
'last_expired', 'scheduler_lock', 'fileloc', 'owners']

tests/www_rbac/test_views.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -492,15 +492,6 @@ def test_xcom(self):
492492
resp = self.client.get(url, follow_redirects=True)
493493
self.check_content_in_response('XCom', resp)
494494

495-
def test_edit_dagrun_page(self):
496-
resp = self.client.get('dagmodel/edit/example_bash_operator', follow_redirects=False)
497-
self.assertEqual(resp.status_code, 200)
498-
499-
def test_edit_dagrun_url(self):
500-
with self.app.test_request_context():
501-
url = url_for('DagModelView.edit', pk='example_bash_operator')
502-
self.assertEqual(url, '/dagmodel/edit/example_bash_operator')
503-
504495
def test_rendered(self):
505496
url = ('rendered?task_id=runme_0&dag_id=example_bash_operator&execution_date={}'
506497
.format(self.percent_encode(self.EXAMPLE_DAG_DEFAULT_DATE)))

0 commit comments

Comments
 (0)