mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-25 06:24:19 +00:00
Fixes
This commit is contained in:
parent
1e84796bd4
commit
cb508c4753
8 changed files with 13 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
from flask import render_template, abort, jsonify, request
|
from flask import render_template, abort, jsonify, request
|
||||||
from nest_backend.database import *
|
from nest_backend.database import *
|
||||||
from flask_jwt_extended import jwt_required
|
from flask_jwt_extended import jwt_required, get_jwt_identity
|
||||||
from nest_backend.gestione import *
|
from nest_backend.gestione import *
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
import datetime
|
import datetime
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from flask import render_template, abort, jsonify, request
|
from flask import render_template, abort, jsonify, request
|
||||||
from nest_backend.database import *
|
from nest_backend.database import *
|
||||||
from flask_jwt_extended import jwt_required
|
from flask_jwt_extended import jwt_required, get_jwt_identity
|
||||||
from nest_backend.gestione import *
|
from nest_backend.gestione import *
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from flask import render_template, abort, jsonify, request
|
from flask import render_template, abort, jsonify, request
|
||||||
from nest_backend.database import *
|
from nest_backend.database import *
|
||||||
from flask_jwt_extended import jwt_required
|
from flask_jwt_extended import jwt_required, get_jwt_identity
|
||||||
from nest_backend.gestione import *
|
from nest_backend.gestione import *
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ from nest_backend.gestione import repository_auth, json_error, json_success, Con
|
||||||
find_user, get_jwt_identity
|
find_user, get_jwt_identity
|
||||||
from nest_backend.database import ext
|
from nest_backend.database import ext
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
from gestione import hashtag_validator
|
from nest_backend.gestione import hashtag_validator
|
||||||
|
|
||||||
|
|
||||||
@cross_origin()
|
@cross_origin()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from flask import render_template, abort, jsonify, request
|
from flask import render_template, abort, jsonify, request
|
||||||
from nest_backend.database import *
|
from nest_backend.database import *
|
||||||
from flask_jwt_extended import jwt_required
|
from flask_jwt_extended import jwt_required, get_jwt_identity
|
||||||
from nest_backend.gestione import *
|
from nest_backend.gestione import *
|
||||||
import datetime
|
import datetime
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
from flask import render_template, abort, jsonify, request
|
from flask import render_template, abort, jsonify, request
|
||||||
from nest_backend.database import *
|
from nest_backend.database import *
|
||||||
from flask_jwt_extended import jwt_required
|
from flask_jwt_extended import jwt_required, get_jwt_identity
|
||||||
from nest_backend.gestione import *
|
from nest_backend.gestione import *
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@cross_origin()
|
@cross_origin()
|
||||||
@jwt_required()
|
@jwt_required()
|
||||||
@repository_auth
|
@repository_auth
|
||||||
|
@ -210,6 +211,9 @@ def page_repository(rid):
|
||||||
type_ = ConditionType(c['type'])
|
type_ = ConditionType(c['type'])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return json_error("Unknown `type` specified."), 400
|
return json_error("Unknown `type` specified."), 400
|
||||||
ext.session.add(Condition(type=type_, content=c['content'], repository_id=rid))
|
content = c['content']
|
||||||
|
if type_ == ConditionType.hashtag:
|
||||||
|
content = hashtag_validator(content)
|
||||||
|
ext.session.add(Condition(type=type_, content=content, repository_id=rid))
|
||||||
ext.session.commit()
|
ext.session.commit()
|
||||||
return json_success(repository.to_json()), 200
|
return json_success(repository.to_json()), 200
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from flask import render_template, abort, jsonify, request
|
from flask import render_template, abort, jsonify, request
|
||||||
from nest_backend.database import *
|
from nest_backend.database import *
|
||||||
from flask_jwt_extended import jwt_required
|
from flask_jwt_extended import jwt_required, get_jwt_identity
|
||||||
from nest_backend.gestione import *
|
from nest_backend.gestione import *
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from flask import render_template, abort, jsonify, request
|
from flask import render_template, abort, jsonify, request
|
||||||
from nest_backend.database import *
|
from nest_backend.database import *
|
||||||
from flask_jwt_extended import jwt_required
|
from flask_jwt_extended import jwt_required, get_jwt_identity
|
||||||
from nest_backend.gestione import *
|
from nest_backend.gestione import *
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue