File tree Expand file tree Collapse file tree 7 files changed +8
-15
lines changed Expand file tree Collapse file tree 7 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def login_required_ajax(f):
28
28
29
29
@wraps (f )
30
30
def wrapper (request , * args , ** kwargs ):
31
- if request .is_ajax () :
31
+ if request .headers . get ( 'x-requested-with' ) == 'XMLHttpRequest' :
32
32
if not request .user or not request .user .is_authenticated :
33
33
return json_view (lambda * a ,
34
34
** kw : {'error' : 'not logged in' })(request ,
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ def test_notifymail(self):
41
41
# It's normal for this command to exit
42
42
pass
43
43
44
- pid = open (pid_file .name , 'r' ).read ()
44
+ with open (pid_file .name , 'r' ) as fp :
45
+ pid = fp .read ()
45
46
os .unlink (pid_file .name )
46
47
47
48
# Give it a second to start
Original file line number Diff line number Diff line change 1
- from django .conf .urls import include
2
- from django .conf .urls import url
1
+ from django .urls import include , re_path as url
3
2
4
3
from . import views
5
4
Original file line number Diff line number Diff line change 1
- try :
2
- from django .urls import include , re_path as url
3
- except ImportError :
4
- from django .conf .urls import include , url
1
+ from django .urls import include , re_path as url
5
2
6
3
from . import views
7
4
Original file line number Diff line number Diff line change 142
142
# django-nyt options
143
143
##########################################
144
144
145
- _enable_channels = True
145
+ _enable_channels = False
146
146
if _enable_channels :
147
147
INSTALLED_APPS .append ('channels' )
148
148
CHANNEL_LAYERS = {
Original file line number Diff line number Diff line change 2
2
from django .conf import settings
3
3
from django .contrib import admin
4
4
from django .contrib .staticfiles .urls import staticfiles_urlpatterns
5
-
6
- try :
7
- from django .urls import include , re_path as url
8
- except ImportError :
9
- from django .conf .urls import include , url
5
+ from django .urls import include , re_path as url
10
6
11
7
12
8
admin .autodiscover ()
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ whitelist_externals=
9
9
sh
10
10
11
11
commands =
12
- sh -c ' ! python test-project/manage.py makemigrations --dry-run --exit -- noinput'
12
+ sh -c ' ! python test-project/manage.py makemigrations --dry-run --noinput'
13
13
python -W all:" " :" " :" " :0 -m coverage run --source =django_nyt runtests.py
14
14
codecov
15
15
You can’t perform that action at this time.
0 commit comments