Skip to content

Commit

Permalink
Trying POST instead of GET for testconn
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Sep 25, 2015
1 parent 83e37f6 commit f95e844
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions panoramix/templates/appbuilder/baselayout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
{% import 'appbuilder/baselib.html' as baselib %}

{% block body %}
{% include 'appbuilder/general/confirm.html' %}
{% include 'appbuilder/general/alert.html' %}
{% include 'appbuilder/general/confirm.html' %}
{% include 'appbuilder/general/alert.html' %}

{% block navbar %}
<header class="top" role="header">
{% include 'appbuilder/navbar.html' %}
</header>
{% endblock %}

{% block uncontained %}{% endblock %}

<div class="container">
<div class="row">
{% block messages %}
Expand All @@ -24,8 +26,6 @@
{% block content_fluid %}
{% endblock %}
</div>
{% block uncontained %}
{% endblock %}

{% block footer %}
<footer>
Expand Down
2 changes: 1 addition & 1 deletion panoramix/templates/panoramix/models/database/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$("#testconn").click(function() {
var url = "/panoramix/testconn";
$.ajax({
method: "GET",
method: "POST",
url: url,
data: { uri: $("#sqlalchemy_uri").val() }
}).done(function() {
Expand Down
7 changes: 3 additions & 4 deletions panoramix/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,11 @@ def save_dash(self, dashboard_id):
return "SUCCESS"

@has_access
@expose("/testconn/")
@expose("/testconn", methods=["POST"])
def testconn(self):
try:
db = create_engine(request.args.get('uri'))
for i in range(15):
request.args.get('uri')
uri = request.form.get('uri')
db = create_engine(uri)
db.connect()
return "SUCCESS"
except Exception as e:
Expand Down

0 comments on commit f95e844

Please sign in to comment.