fix flask parameter retrieval
This commit is contained in:
parent
93a4971d79
commit
3d818ad417
2 changed files with 3 additions and 5 deletions
|
@ -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…
Add table
Reference in a new issue