File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
DjangoPlugin/tracdjangoplugin Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 24
24
python-version : ' 3.8'
25
25
- run : pip install "tinycss2>=1.2.0"
26
26
- run : python noshadows.py --tests
27
+ env :
28
+ PYTHONWARNINGS : error
27
29
28
30
tracdjangoplugin :
29
31
runs-on : ubuntu-20.04
39
41
run : python -m django test tracdjangoplugin.tests
40
42
env :
41
43
DJANGO_SETTINGS_MODULE : tracdjangoplugin.settings_tests
44
+ PYTHONWARNINGS : error
42
45
43
46
traccheck :
44
47
runs-on : ubuntu-20.04
53
56
- run : python traccheck.py lint trac-env/
54
57
env :
55
58
DJANGO_SETTINGS_MODULE : tracdjangoplugin.settings_tests
59
+ PYTHONWARNINGS : error
56
60
- run : python traccheck.py components --check .TRACFREEZE.txt trac-env/
57
61
env :
58
62
DJANGO_SETTINGS_MODULE : tracdjangoplugin.settings_tests
63
+ PYTHONWARNINGS : error
Original file line number Diff line number Diff line change 11
11
12
12
from django .conf import settings
13
13
from django .contrib .auth .forms import AuthenticationForm
14
- from django .utils .http import is_safe_url
14
+ from django .utils .encoding import iri_to_uri
15
+ from django .utils .http import url_has_allowed_host_and_scheme
15
16
16
17
17
18
class CustomTheme (Component ):
@@ -135,11 +136,14 @@ def do_post(self, req):
135
136
136
137
def _get_safe_redirect_url (self , req ):
137
138
host = urlparse (req .base_url ).hostname
138
- redirect_url = req .args .get ("next" , "" ) or settings .LOGIN_REDIRECT_URL
139
- if is_safe_url (redirect_url , allowed_hosts = [host ]):
140
- return redirect_url
141
- else :
142
- return settings .LOGIN_REDIRECT_URL
139
+ redirect_url = iri_to_uri (req .args .get ("next" , "" ))
140
+
141
+ if not redirect_url :
142
+ redirect_url = settings .LOGIN_REDIRECT_URL
143
+ elif not url_has_allowed_host_and_scheme (redirect_url , allowed_hosts = [host ]):
144
+ redirect_url = settings .LOGIN_REDIRECT_URL
145
+
146
+ return redirect_url
143
147
144
148
145
149
class ReservedUsernamesComponent (Component ):
Original file line number Diff line number Diff line change 1
1
# spam-filter doesn't work without babel (but somehow doesn't list it in its requirements)
2
2
Trac [pygments, babel ]== 1.6.0
3
3
psycopg2 == 2.9.9 --no-binary =psycopg2
4
- Django == 1.11.29
4
+ Django == 3.2.24
5
5
libsass == 0.23.0
6
6
7
7
# Trac plugins
You can’t perform that action at this time.
0 commit comments