diff --git a/postgrestutils/__init__.py b/postgrestutils/__init__.py index 7e075e336a6ff44ce7925af53c3b82751c5f20d9..68487c33f9a9e78e17559547e1ad54539e3dceb6 100644 --- a/postgrestutils/__init__.py +++ b/postgrestutils/__init__.py @@ -1,8 +1,9 @@ import logging -from . import app_settings from requests import HTTPError +from . import app_settings + logger = logging.getLogger("postgrestutils") default_app_config = "postgrestutils.apps.PostgrestUtilsConfig" diff --git a/postgrestutils/apps.py b/postgrestutils/apps.py index e0c67da97ffac44bbe7429660d332af1ebbf4d10..9d219300e765681913e6e599688b7cc543900020 100644 --- a/postgrestutils/apps.py +++ b/postgrestutils/apps.py @@ -1,6 +1,8 @@ from django.apps import AppConfig from django.contrib.auth.signals import user_logged_in + from postgrestutils.helpers import autofetch + from . import app_settings diff --git a/postgrestutils/helpers.py b/postgrestutils/helpers.py index b502ab735da014fdf8f194748d284528c574f6c1..2e2ec344e8c109c8d9e1dcaf5f47837718528212 100644 --- a/postgrestutils/helpers.py +++ b/postgrestutils/helpers.py @@ -1,13 +1,13 @@ -from . import app_settings from django.conf import settings -from .signals import user_account_fetched from postgrestutils.client import pgrest_client +from . import app_settings +from .signals import user_account_fetched + def autofetch(sender, **kwargs): """Fetch user account on login based on the AUTOFETCH configuration""" - payload = { 'select': app_settings.AUTOFETCH } diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..2048ccfdbac9527ec0b53b4cd67cd5807cfb6ac4 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,14 @@ +[flake8] +max-line-length = 119 +exclude = **/settings/* + +[isort] +combine_as_import = true +default_section = THIRDPARTY +include_trailing_comma = true +known_first_party = postgrestutils +known_django = django +sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +line_length = 79 +multi_line_output = 5 +not_skip = __init__.py diff --git a/setup.py b/setup.py index 20c21cc6627ac75de613962e7b96f43c230bf53a..b9c5a61f170003f6b329149c5416e4e3163ff2c8 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ import os -from setuptools import setup, find_packages + +from setuptools import find_packages, setup README = open(os.path.join(os.path.dirname(__file__), "README.md")).read()