[Python-modules-commits] [python-social-auth] 97/131: Move import to the top, apply PEP8

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:17:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.20
in repository python-social-auth.

commit 74d8345c2a0ab93afb5d46a0fbf3d676bd04fbfe
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Sat Aug 6 03:58:52 2016 -0300

    Move import to the top, apply PEP8
---
 social/apps/django_app/default/admin.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/social/apps/django_app/default/admin.py b/social/apps/django_app/default/admin.py
index cf17b77..5cee753 100644
--- a/social/apps/django_app/default/admin.py
+++ b/social/apps/django_app/default/admin.py
@@ -1,4 +1,6 @@
 """Admin settings"""
+from itertools import chain
+
 from django.conf import settings
 from django.contrib import admin
 
@@ -31,15 +33,15 @@ class UserSocialAuthOption(admin.ModelAdmin):
 
     @staticmethod
     def _get_all_field_names(model):
-        from itertools import chain
-
-        return list(set(chain.from_iterable(
-            (field.name, field.attname) if hasattr(field, 'attname') else (field.name,)
+        names = chain.from_iterable(
+            (field.name, field.attname)
+                if hasattr(field, 'attname') else (field.name,)
             for field in model.get_fields()
             # For complete backwards compatibility, you may want to exclude
             # GenericForeignKey from the results.
             if not (field.many_to_one and field.related_model is None)
-        )))
+        )
+        return list(set(names))
 
 
 class NonceOption(admin.ModelAdmin):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git



More information about the Python-modules-commits mailing list