From 11ec57387ea6a2ff188a645d82087d78baceedf0 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Sep 2025 10:13:07 -0500 Subject: [PATCH] fix: fix 'assignment-from-no-return' for pylint --- .pylintrc | 1 - src/wuttaweb/views/master.py | 11 +++++++---- tests/views/test_master.py | 5 +++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index af61f35..fc8037d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -4,7 +4,6 @@ disable=fixme, arguments-differ, arguments-renamed, - assignment-from-no-return, attribute-defined-outside-init, consider-using-dict-comprehension, consider-using-dict-items, diff --git a/src/wuttaweb/views/master.py b/src/wuttaweb/views/master.py index 94c61df..be7d7f2 100644 --- a/src/wuttaweb/views/master.py +++ b/src/wuttaweb/views/master.py @@ -918,7 +918,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods if not term: return [] - data = self.autocomplete_data(term) + data = self.autocomplete_data(term) # pylint: disable=assignment-from-none if not data: return [] @@ -932,7 +932,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods return results - def autocomplete_data(self, term): + def autocomplete_data(self, term): # pylint: disable=unused-argument """ Should return the data/query for the "matching" model records, based on autocomplete search term. This is called by @@ -944,6 +944,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods :returns: List of data records, or SQLAlchemy query. """ + return None def autocomplete_normalize(self, obj): """ @@ -1007,13 +1008,13 @@ class MasterView(View): # pylint: disable=too-many-public-methods obj = self.get_instance() filename = self.request.GET.get("filename", None) - path = self.download_path(obj, filename) + path = self.download_path(obj, filename) # pylint: disable=assignment-from-none if not path or not os.path.exists(path): return self.notfound() return self.file_response(path) - def download_path(self, obj, filename): + def download_path(self, obj, filename): # pylint: disable=unused-argument """ Should return absolute path on disk, for the given object and filename. Result will be used to return a file response to @@ -1034,6 +1035,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods the :meth:`download()` view will return a 404 not found response. """ + return None ############################## # execute methods @@ -1305,6 +1307,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods Note that their order does not matter since the template must explicitly define field layout etc. """ + return [] def configure_gather_settings( self, diff --git a/tests/views/test_master.py b/tests/views/test_master.py index 6edc420..cd04f8a 100644 --- a/tests/views/test_master.py +++ b/tests/views/test_master.py @@ -1656,6 +1656,11 @@ class TestMasterView(WebTestCase): count = self.session.query(model.Setting).count() self.assertEqual(count, 0) + def test_configure_get_simple_settings(self): + view = self.make_view() + settings = view.configure_get_simple_settings() + self.assertEqual(settings, []) + def test_configure_gather_settings(self): view = self.make_view()