File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
- from django .core .checks import Tags , Warning , register
1
+ from django .core .checks import Tags , Error , Warning , register
2
2
3
3
4
4
@register (Tags .compatibility )
@@ -19,3 +19,22 @@ def pagination_system_check(app_configs, **kwargs):
19
19
)
20
20
)
21
21
return errors
22
+
23
+
24
+ @register (Tags .compatibility )
25
+ def www_authneticate_behavior_setting_check (app_configs , ** kwargs ):
26
+ errors = []
27
+ # WWW_AUTHENTICATE_BEHAVIOR setting must be 'first' or 'all'
28
+ from rest_framework .settings import api_settings
29
+ setting = api_settings .WWW_AUTHENTICATE_BEHAVIOR
30
+ if setting not in ['first' , 'all' ]:
31
+ errors .append (
32
+ Error (
33
+ "The rest_framework setting WWW_AUTHENTICATE_BEHAVIOR must be either "
34
+ f"'first' or 'all' (it is currently set to '{ setting } ')." ,
35
+ hint = "Set WWW_AUTHENTICATE_BEHAVIOR to either 'first' or 'all', "
36
+ "or leave it unset (the default value is 'first')." ,
37
+ id = "rest_framework.E001" ,
38
+ )
39
+ )
40
+ return errors
You can’t perform that action at this time.
0 commit comments