Skip to content

Commit 89a28c6

Browse files
committed
chore: apply pre-commit fixes
Automated update of shared files from the social-core repository, see https://github.com/python-social-auth/.github/blob/main/repo-sync.py
1 parent 568ac9f commit 89a28c6

File tree

5 files changed

+54
-50
lines changed

5 files changed

+54
-50
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414
## [1.0.0](https://github.com/python-social-auth/social-app-django/releases/tag/1.0.0) - 2017-01-22
1515

1616
### Added
17+
1718
- Added partial pipeline db storage solution
1819

1920
### Changed
21+
2022
- Removed usage of set/get current strategy methods
2123

2224
## [0.2.0](https://github.com/python-social-auth/social-app-django/releases/tag/0.2.0) - 2016-12-28
2325

2426
### Changed
27+
2528
- Fixed setup.py requirements loading by defining dependency links
2629

2730
## [0.1.0](https://github.com/python-social-auth/social-app-django/releases/tag/0.1.0) - 2016-12-28
2831

2932
### Changed
33+
3034
- Fixed django-mongoengine dependency (port of [#1027](https://github.com/omab/python-social-auth/pull/1027)
3135
by erezarnon)
3236

3337
## [0.0.1](https://github.com/python-social-auth/social-app-django/releases/tag/0.0.1) - 2016-11-27
3438

3539
### Changed
40+
3641
- Split from the monolitic [python-social-auth](https://github.com/omab/python-social-auth)
3742
codebase

setup.py

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
1-
# -*- coding: utf-8 -*-
21
"""Setup file for easy installation"""
3-
from os.path import join, dirname
2+
3+
from os.path import dirname, join
4+
45
from setuptools import setup
56

67

78
def long_description():
8-
return open(join(dirname(__file__), 'README.md')).read()
9+
return open(join(dirname(__file__), "README.md")).read()
10+
911

1012
def load_requirements():
11-
lines = open(join(dirname(__file__), 'requirements.txt')).readlines()
12-
return [line for line in lines if not line.startswith('-e')]
13+
lines = open(join(dirname(__file__), "requirements.txt")).readlines()
14+
return [line for line in lines if not line.startswith("-e")]
15+
1316

1417
def load_dependency_links():
15-
lines = open(join(dirname(__file__), 'requirements.txt')).readlines()
16-
return [line for line in lines if line.startswith('-e')]
18+
lines = open(join(dirname(__file__), "requirements.txt")).readlines()
19+
return [line for line in lines if line.startswith("-e")]
20+
1721

1822
setup(
19-
name='social-auth-app-django-mongoengine',
20-
version=__import__('social_django_mongoengine').__version__,
21-
author='Matias Aguirre',
22-
author_email='[email protected]',
23-
description='Python Social Authentication, Mongoengine Django integration.',
24-
license='BSD',
25-
keywords='django, social auth, mongoengine',
26-
url='https://github.com/python-social-auth/social-app-django-mongoengine',
27-
packages=[
28-
'social_django_mongoengine'
29-
],
23+
name="social-auth-app-django-mongoengine",
24+
version=__import__("social_django_mongoengine").__version__,
25+
author="Matias Aguirre",
26+
author_email="[email protected]",
27+
description="Python Social Authentication, Mongoengine Django integration.",
28+
license="BSD",
29+
keywords="django, social auth, mongoengine",
30+
url="https://github.com/python-social-auth/social-app-django-mongoengine",
31+
packages=["social_django_mongoengine"],
3032
long_description=long_description(),
3133
install_requires=load_requirements(),
3234
dependency_linkes=load_dependency_links(),
3335
classifiers=[
34-
'Development Status :: 4 - Beta',
35-
'Topic :: Internet',
36-
'License :: OSI Approved :: BSD License',
37-
'Intended Audience :: Developers',
38-
'Environment :: Web Environment',
39-
'Programming Language :: Python',
40-
'Programming Language :: Python :: 2.7',
41-
'Programming Language :: Python :: 3'
36+
"Development Status :: 4 - Beta",
37+
"Topic :: Internet",
38+
"License :: OSI Approved :: BSD License",
39+
"Intended Audience :: Developers",
40+
"Environment :: Web Environment",
41+
"Programming Language :: Python",
42+
"Programming Language :: Python :: 2.7",
43+
"Programming Language :: Python :: 3",
4244
],
43-
zip_safe=False
45+
zip_safe=False,
4446
)

social_django_mongoengine/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.0.0'
1+
__version__ = "1.0.0"

social_django_mongoengine/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33

44
class PythonSocialAuthConfig(AppConfig):
5-
name = 'social'
6-
label = 'social_auth'
7-
verbose_name = 'Python Social Auth'
5+
name = "social"
6+
label = "social_auth"
7+
verbose_name = "Python Social Auth"

social_django_mongoengine/models.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
MongoEngine Django models for Social Auth.
33
Requires MongoEngine 0.8.6 or higher.
44
"""
5-
from django.conf import settings
65

6+
from django.conf import settings
77
from mongoengine import Document, ReferenceField
88
from mongoengine.queryset import OperationError
9+
from social_core.utils import module_member, setting_name
10+
from social_mongoengine.storage import (
11+
BaseMongoengineStorage,
12+
MongoengineAssociationMixin,
13+
MongoengineCodeMixin,
14+
MongoengineNonceMixin,
15+
MongoenginePartialMixin,
16+
MongoengineUserMixin,
17+
)
918

10-
from social_core.utils import setting_name, module_member
11-
from social_mongoengine.storage import MongoengineUserMixin, \
12-
MongoengineAssociationMixin, \
13-
MongoengineNonceMixin, \
14-
MongoengineCodeMixin, \
15-
MongoenginePartialMixin, \
16-
BaseMongoengineStorage
17-
18-
19-
UNUSABLE_PASSWORD = '!' # Borrowed from django 1.4
19+
UNUSABLE_PASSWORD = "!" # Borrowed from django 1.4
2020

2121

2222
def _get_user_model():
@@ -26,22 +26,24 @@ def _get_user_model():
2626
Use the model defined in SOCIAL_AUTH_USER_MODEL if defined, or
2727
defaults to MongoEngine's configured user document class.
2828
"""
29-
custom_model = getattr(settings, setting_name('USER_MODEL'), None)
29+
custom_model = getattr(settings, setting_name("USER_MODEL"), None)
3030
if custom_model:
3131
return module_member(custom_model)
3232

3333
try:
3434
from django_mongoengine.mongo_auth.managers import get_user_document
35+
3536
return get_user_document()
3637
except ImportError:
37-
return module_member('mongoengine.django.auth.User')
38+
return module_member("mongoengine.django.auth.User")
3839

3940

4041
USER_MODEL = _get_user_model()
4142

4243

4344
class UserSocialAuth(Document, MongoengineUserMixin):
4445
"""Social Auth association model"""
46+
4547
user = ReferenceField(USER_MODEL)
4648

4749
@classmethod
@@ -51,22 +53,18 @@ def user_model(cls):
5153

5254
class Nonce(Document, MongoengineNonceMixin):
5355
"""One use numbers"""
54-
pass
5556

5657

5758
class Association(Document, MongoengineAssociationMixin):
5859
"""OpenId account association"""
59-
pass
6060

6161

6262
class Code(Document, MongoengineCodeMixin):
6363
"""Mail validation single one time use code"""
64-
pass
6564

6665

6766
class Partial(Document, MongoenginePartialMixin):
6867
"""Partial pipeline data"""
69-
pass
7068

7169

7270
class DjangoStorage(BaseMongoengineStorage):
@@ -78,5 +76,4 @@ class DjangoStorage(BaseMongoengineStorage):
7876

7977
@classmethod
8078
def is_integrity_error(cls, exception):
81-
return exception.__class__ is OperationError and \
82-
'E11000' in exception.message
79+
return exception.__class__ is OperationError and "E11000" in exception.message

0 commit comments

Comments
 (0)