diff --git a/TODO b/TODO index 6c5d0f6..1d5e3a2 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,16 @@ ## GENERAL * ignore face should ignore ALL matching faces (re: Cams mate) + * should be using jsonify to return real json to my API calls, e.g: + response = make_response( + jsonify( + {"message": str(FLAMSG_ERR_SEC_ACCESS_DENIED), "severity": "danger"} + ), + 401, + ) + response.headers["Content-Type"] = "application/json" + return response + * change the rotation code to use that jpeg util to reduce/remove compression loss? * About page -> find a way to push git commit/date through to f/e, so we can see what release we are running diff --git a/ai.py b/ai.py index 7df1378..91fe92f 100644 --- a/ai.py +++ b/ai.py @@ -12,7 +12,6 @@ from flask_login import login_required, current_user from PIL import Image import io import base64 -import json from job import Job, JobExtra, Joblog, NewJob from face import Face, FaceFileLink, FaceRefimgLink diff --git a/face.py b/face.py index ff4547c..3caec79 100644 --- a/face.py +++ b/face.py @@ -3,13 +3,6 @@ from sqlalchemy import Sequence from sqlalchemy.exc import SQLAlchemyError from shared import PA - -# DEL ME SOON -from flask_login import login_required -from flask import render_template -import json - - # pylint: disable=no-member ################################################################################ diff --git a/files.py b/files.py index 880abc6..93ae516 100644 --- a/files.py +++ b/files.py @@ -1,6 +1,6 @@ from wtforms import SubmitField, StringField, HiddenField, validators, Form from flask_wtf import FlaskForm -from flask import request, render_template, redirect, send_from_directory, url_for, jsonify +from flask import request, render_template, redirect, send_from_directory, url_for from path import MovePathDetails from main import db, app, ma from sqlalchemy import Sequence @@ -17,7 +17,6 @@ import numpy import cv2 import time import re -import json from datetime import datetime import pytz from flask_login import login_required, current_user diff --git a/main.py b/main.py index 616f736..e767ec4 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -from flask import Flask, render_template, request, redirect, jsonify, url_for, render_template_string +from flask import Flask, render_template, request, redirect, url_for, render_template_string from flask_compress import Compress from flask_sqlalchemy import SQLAlchemy from sqlalchemy.exc import SQLAlchemyError diff --git a/pa_job_manager.py b/pa_job_manager.py index 91d1e56..4a503c0 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -45,7 +45,6 @@ import face_recognition import re import re import sys -import json import ffmpeg import uuid diff --git a/person.py b/person.py index d59960f..07ccedb 100644 --- a/person.py +++ b/person.py @@ -14,7 +14,6 @@ from path import Path, PathType from job import JobExtra, NewJob import os -import json import time from PIL import Image import base64 @@ -68,14 +67,6 @@ class Person(PA,db.Model): firstname = db.Column(db.String(48), unique=False, nullable=False) refimg = db.relationship('Refimg', secondary=PersonRefimgLink.__table__, order_by=Refimg.id) -################################################################################ -# Helper class that inherits a .dump() method to turn class Person into json / useful in jinja2 -################################################################################ -class PersonSchema(ma.SQLAlchemyAutoSchema): - class Meta: - model = Person - ordered = True - ################################################################################ # Helper class that defines a form for person, used to make html