File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
python/ql/src/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2024,8 +2024,15 @@ private module Django {
20242024 result = djangoRouteHandlerFunctionTracker ( DataFlow:: TypeTracker:: end ( ) , func )
20252025 }
20262026
2027- /** A class that might be a django View class. */
2028- class PossibleDjangoViewClass extends Class {
2027+ /**
2028+ * In order to recognize a class as being a django view class, based on the `as_view`
2029+ * call, we need to be able to track such calls on _any_ class. This is provided by
2030+ * the member predicates of this QL class.
2031+ *
2032+ * As such, a Python class being part of `DjangoViewClassHelper` doesn't signify that
2033+ * we model it as a django view class.
2034+ */
2035+ class DjangoViewClassHelper extends Class {
20292036 /** Gets a reference to this class. */
20302037 private DataFlow:: Node getARef ( DataFlow:: TypeTracker t ) {
20312038 t .start ( ) and
@@ -2061,7 +2068,7 @@ private module Django {
20612068 }
20622069
20632070 /** A class that we consider a django View class. */
2064- abstract class DjangoViewClass extends PossibleDjangoViewClass {
2071+ abstract class DjangoViewClass extends DjangoViewClassHelper {
20652072 /** Gets a function that could handle incoming requests, if any. */
20662073 Function getARequestHandler ( ) {
20672074 // TODO: This doesn't handle attribute assignment. Should be OK, but analysis is not as complete as with
You can’t perform that action at this time.
0 commit comments