1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-28 23:44:19 +00:00
This commit is contained in:
Lorenzo Balugani 2021-05-12 22:22:42 +02:00
parent 1e84796bd4
commit cb508c4753
8 changed files with 13 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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