(self, request)
| 35 | return self.render() |
| 36 | |
| 37 | def post(self, request): |
| 38 | c = request.POST.get("database_connection", default_db_connection_id()) |
| 39 | show = url_get_show(request) |
| 40 | sql = request.POST.get("sql", "") |
| 41 | |
| 42 | query = Query(sql=sql, title="Playground", database_connection_id=c) |
| 43 | |
| 44 | passes_blacklist, failing_words = query.passes_blacklist() |
| 45 | |
| 46 | error = MSG_FAILED_BLACKLIST % ", ".join( |
| 47 | failing_words |
| 48 | ) if not passes_blacklist else None |
| 49 | |
| 50 | run_query = not bool(error) if show else False |
| 51 | return self.render_with_sql( |
| 52 | request, |
| 53 | query, |
| 54 | run_query=run_query, |
| 55 | error=error |
| 56 | ) |
| 57 | |
| 58 | def render(self): |
| 59 | return self.render_template( |
nothing calls this directly
no test coverage detected