mik-laj commented on a change in pull request #10897:
URL: https://github.com/apache/airflow/pull/10897#discussion_r488734190



##########
File path: airflow/models/dag.py
##########
@@ -1621,6 +1621,13 @@ def sync_to_db(self, sync_time=None, session=None):
         """
         self.bulk_sync_to_db([self], sync_time, session)
 
+    def get_default_view(self):
+        """This is only there for backward compatible jinja2 templates"""
+        if self.default_view is None:
+            return conf.get('webserver', 'dag_default_view').lower()
+        else:
+            return self.default_view

Review comment:
       ```suggestion
       @property
       def default_view(self):
           """This is only there for backward compatible jinja2 templates"""
           if self._default_view is None:
               return conf.get('webserver', 'dag_default_view').lower()
           else:
               return self._default_view
       @default_view.setter
       def default_view(self, value):
           self._default_view= value
   ```
   This way we won't have two similar public attributes of `default_view` 
property, `get_default_view` method.




----------------------------------------------------------------
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]


Reply via email to