File tree Expand file tree Collapse file tree 1 file changed +3
-25
lines changed Expand file tree Collapse file tree 1 file changed +3
-25
lines changed Original file line number Diff line number Diff line change 1
- from django .apps import AppConfig , apps
2
- from django .core .exceptions import ImproperlyConfigured
3
- from django .db import router
1
+ from django .apps import AppConfig
4
2
5
3
6
4
class DOTConfig (AppConfig ):
7
5
name = "oauth2_provider"
8
6
verbose_name = "Django OAuth Toolkit"
9
7
10
- def _validate_token_configuration (self ):
11
- from .settings import oauth2_settings
12
-
13
- databases = set (
14
- router .db_for_write (apps .get_model (model ))
15
- for model in (
16
- oauth2_settings .ACCESS_TOKEN_MODEL ,
17
- oauth2_settings .ID_TOKEN_MODEL ,
18
- oauth2_settings .REFRESH_TOKEN_MODEL ,
19
- )
20
- )
21
-
22
- # This is highly unlikely, but let's warn people just in case it does.
23
- # If the tokens were allowed to be in different databases this would require all
24
- # writes to have a transaction around each database. Instead, let's enforce that
25
- # they all live together in one database.
26
- # The tokens are not required to live in the default database provided the Django
27
- # routers know the correct database for them.
28
- if len (databases ) > 1 :
29
- raise ImproperlyConfigured ("the token models are expected to be stored in the same database." )
30
-
31
8
def ready (self ):
32
- self ._validate_token_configuration ()
9
+ # Import checks to ensure they run.
10
+ from . import checks # noqa: F401
You can’t perform that action at this time.
0 commit comments