[geany/www.geany.org] 0fdb4c: Fix PyLint warnings

Enrico Tröger git-noreply at xxxxx
Sun May 3 18:19:14 UTC 2020


Branch:      refs/heads/master
Author:      Enrico Tröger <enrico.troeger at uvena.de>
Committer:   Enrico Tröger <enrico.troeger at uvena.de>
Date:        Sun, 03 May 2020 18:19:14 UTC
Commit:      0fdb4c805c018175d1fac6a1829a50db60c08afe
             https://github.com/geany/www.geany.org/commit/0fdb4c805c018175d1fac6a1829a50db60c08afe

Log Message:
-----------
Fix PyLint warnings

PyLint emits a different warning for overridden Model.save() method
with Django 2.2. It's still correct to ignore the warning in this
specific case.

We need to capture the "mezzanine_pagedown.filters.custom" twice as we
get difference line numbers between Python 3.8 and older versions.


Modified Paths:
--------------
    geany/settings.py
    latest_version/models.py
    news/models.py
    pastebin/forms.py
    pastebin/models.py

Modified: geany/settings.py
6 lines changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -602,6 +602,12 @@ def skip_404_not_found(record):
     category=FutureWarning,
     module='mezzanine.core.templatetags.mezzanine_tags',
     lineno=481)
+warnings.filterwarnings(
+    action='ignore',
+    message='^mezzanine_pagedown.filters.custom needs to ensure that any untrusted inputs.*',
+    category=FutureWarning,
+    module='mezzanine.core.templatetags.mezzanine_tags',
+    lineno=487)
 
 ##################
 # LOCAL SETTINGS #


Modified: latest_version/models.py
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -29,7 +29,7 @@ class Meta:
         verbose_name_plural = 'Latest Version'
 
     # ----------------------------------------------------------------------
-    def save(self, *args, **kwargs):  # pylint: disable=arguments-differ
+    def save(self, *args, **kwargs):  # pylint: disable=signature-differs
         """Save but replace the existing row instead of adding a new one"""
         self.id = 1  # pylint: disable=invalid-name,attribute-defined-outside-init
         super(LatestVersion, self).save(*args, **kwargs)


Modified: news/models.py
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -85,7 +85,7 @@ class Meta:
         verbose_name_plural = _('News')
 
     # ----------------------------------------------------------------------
-    def save(self, *args, **kwargs):  # pylint: disable=arguments-differ
+    def save(self, *args, **kwargs):  # pylint: disable=signature-differs
         if not self.slug:
             self.slug = slugify(self.title)
         super(NewsPost, self).save(*args, **kwargs)


Modified: pastebin/forms.py
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -68,7 +68,7 @@ def clean_content(self):
         return content
 
     # ----------------------------------------------------------------------
-    def save(self, *args, **kwargs):  # pylint: disable=arguments-differ
+    def save(self, *args, **kwargs):  # pylint: disable=signature-differs
         # Set parent snippet
         parent = kwargs.pop('parent', None)
         if parent:


Modified: pastebin/models.py
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -100,7 +100,7 @@ def content_splitted(self):
         return self.content_highlighted.splitlines()
 
     # ----------------------------------------------------------------------
-    def save(self, *args, **kwargs):  # pylint: disable=arguments-differ
+    def save(self, *args, **kwargs):  # pylint: disable=signature-differs
         if not self.pk and not self.secret_id:
             self.secret_id = generate_secret_id()
         if not self.published:
@@ -112,7 +112,7 @@ def save(self, *args, **kwargs):  # pylint: disable=arguments-differ
         cache.delete_many([CACHE_KEY_SNIPPET_LIST_NO_CONTENT, CACHE_KEY_SNIPPET_LIST_FULL])
 
     # ----------------------------------------------------------------------
-    def delete(self, *args, **kwargs):  # pylint: disable=arguments-differ
+    def delete(self, *args, **kwargs):  # pylint: disable=signature-differs
         super(Snippet, self).delete(*args, **kwargs)
         # invalidate cache
         cache.delete_many([CACHE_KEY_SNIPPET_LIST_NO_CONTENT, CACHE_KEY_SNIPPET_LIST_FULL])



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list