Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1730125

Browse files
committed
Python: Add missing type-tracking step for django.views
Easy to overlook, and will onyl be caught by tests if they use `import parent.thing` and not `from parent import thing`
1 parent 54725cc commit 1730125

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

python/ql/src/semmle/python/frameworks/Django.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private module Django {
3535
* WARNING: Only holds for a few predefined attributes.
3636
*/
3737
private DataFlow::Node django_attr(DataFlow::TypeTracker t, string attr_name) {
38-
attr_name in ["db", "urls", "http", "conf"] and
38+
attr_name in ["db", "urls", "http", "conf", "views"] and
3939
(
4040
t.start() and
4141
result = DataFlow::importNode("django" + "." + attr_name)

python/ql/test/experimental/library-tests/frameworks/django-v2-v3/routing_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get(self, request, untrusted): # $ requestHandler routedParameter=untrusted
3939

4040
# direct import with full path to `View` class (previously not supported)
4141
class ClassView2(django.views.generic.base.View):
42-
def get(self, request): # $ MISSING: requestHandler
42+
def get(self, request): # $ requestHandler
4343
pass
4444

4545

0 commit comments

Comments
 (0)