fix flask parameter retrieval
This commit is contained in:
parent
599838af1f
commit
3382a0a3f4
@ -4,7 +4,6 @@
|
||||
import logging
|
||||
from flask import abort, jsonify, request
|
||||
|
||||
from stacosys.conf.config import ConfigParameter
|
||||
from stacosys.interface import app
|
||||
from stacosys.model.comment import Comment
|
||||
|
||||
@ -22,7 +21,7 @@ def query_comments():
|
||||
comments = []
|
||||
try:
|
||||
token = request.args.get("token", "")
|
||||
if token != app.config.get(ConfigParameter.SITE_TOKEN):
|
||||
if token != app.config.get("SITE_TOKEN"):
|
||||
abort(401)
|
||||
|
||||
url = request.args.get("url", "")
|
||||
@ -56,7 +55,7 @@ def query_comments():
|
||||
def get_comments_count():
|
||||
try:
|
||||
token = request.args.get("token", "")
|
||||
if token != app.config.get(ConfigParameter.SITE_TOKEN):
|
||||
if token != app.config.get("SITE_TOKEN"):
|
||||
abort(401)
|
||||
|
||||
url = request.args.get("url", "")
|
||||
|
||||
@ -5,7 +5,6 @@ import logging
|
||||
from datetime import datetime
|
||||
from flask import abort, redirect, request
|
||||
|
||||
from stacosys.conf.config import ConfigParameter
|
||||
from stacosys.interface import app
|
||||
from stacosys.model.comment import Comment
|
||||
|
||||
@ -21,7 +20,7 @@ def new_form_comment():
|
||||
|
||||
# validate token: retrieve site entity
|
||||
token = data.get("token", "")
|
||||
if token != app.config.get(ConfigParameter.SITE_TOKEN):
|
||||
if token != app.config.get("SITE_TOKEN"):
|
||||
abort(401)
|
||||
|
||||
# honeypot for spammers
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user