Skip to content
Snippets Groups Projects
Commit 4d56dbb9 authored by robban64's avatar robban64
Browse files

fix: url(/) for swagger and code_list

parent d1e321f0
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ def create_app(config_name="configmodule.DevelopmentConfig"):
return redirect(rp[:-1])
@app.after_request
def set_core(response):
def set_corse(response):
header = response.headers
header["Access-Control-Allow-Origin"] = "*"
return response
......
......@@ -13,7 +13,7 @@ schema = QuestionAlternativeDTO.schema
list_schema = QuestionAlternativeDTO.list_schema
@api.route("/")
@api.route("")
@api.param("competition_id, slide_id, question_id")
class QuestionAlternativeList(Resource):
@check_jwt(editor=True)
......
......@@ -13,7 +13,7 @@ schema = QuestionAnswerDTO.schema
list_schema = QuestionAnswerDTO.list_schema
@api.route("/")
@api.route("")
@api.param("competition_id, team_id")
class QuestionAnswerList(Resource):
@check_jwt(editor=True)
......
......@@ -12,7 +12,7 @@ schema = CodeDTO.schema
list_schema = CodeDTO.list_schema
@api.route("/")
@api.route("")
@api.param("competition_id")
class CodesList(Resource):
@check_jwt(editor=True)
......
......@@ -15,7 +15,7 @@ rich_schema = CompetitionDTO.rich_schema
list_schema = CompetitionDTO.list_schema
@api.route("/")
@api.route("")
class CompetitionsList(Resource):
@check_jwt(editor=True)
def post(self):
......
......@@ -35,7 +35,7 @@ class ComponentByID(Resource):
return {}, codes.NO_CONTENT
@api.route("/")
@api.route("")
@api.param("competition_id, slide_id")
class ComponentList(Resource):
@check_jwt(editor=True)
......
......@@ -12,7 +12,7 @@ schema = SlideDTO.schema
list_schema = SlideDTO.list_schema
@api.route("/")
@api.route("")
@api.param("competition_id")
class SlidesList(Resource):
@check_jwt(editor=True)
......
......@@ -12,7 +12,7 @@ schema = TeamDTO.schema
list_schema = TeamDTO.list_schema
@api.route("/")
@api.route("")
@api.param("competition_id")
class TeamsList(Resource):
@check_jwt(editor=True)
......
......@@ -27,7 +27,7 @@ def edit_user(item_user, args):
return dbc.edit.default(item_user, **args)
@api.route("/")
@api.route("")
class UsersList(Resource):
@check_jwt(editor=True)
def get(self):
......
......@@ -39,13 +39,10 @@ def code_by_code(code):
def code_list(competition_id):
""" Gets a list of all code objects associated with a the provided competition. """
team_view_id = 1
join_filters = (Code.view_type_id == team_view_id) & (Team.id == Code.pointer)
filters = ((Code.view_type_id != team_view_id) & (Code.pointer == competition_id))(
(Code.view_type_id == team_view_id) & (competition_id == Team.competition_id)
)
return Code.query.join(Team, join_filters, isouter=True).filter(filters).all()
# team_view_id = 1
join_competition = Competition.id == Code.pointer
filters = Competition.id == competition_id
return Code.query.join(Competition, join_competition).filter(filters).all()
### Users ###
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment