| 97 | return swap_params(self.sql, self.available_params()) |
| 98 | |
| 99 | def execute_query_only(self): |
| 100 | # check blacklist every time sql is run to catch parameterized SQL |
| 101 | passes_blacklist_flag, failing_words = self.passes_blacklist() |
| 102 | |
| 103 | error = MSG_FAILED_BLACKLIST % ", ".join( |
| 104 | failing_words) if not passes_blacklist_flag else None |
| 105 | |
| 106 | if error: |
| 107 | raise ValidationError( |
| 108 | error, |
| 109 | code="InvalidSql" |
| 110 | ) |
| 111 | conn = self.database_connection or default_db_connection() |
| 112 | return QueryResult( |
| 113 | self.final_sql(), conn.as_django_connection() |
| 114 | ) |
| 115 | |
| 116 | def execute_with_logging(self, executing_user): |
| 117 | ql = self.log(executing_user) |