mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
fix flake 8
This commit is contained in:
@@ -3,7 +3,16 @@ from datetime import datetime
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
|
|
||||||
from flask import Response, abort, app, jsonify, render_template, request, session, url_for
|
from flask import (
|
||||||
|
Response,
|
||||||
|
abort,
|
||||||
|
app,
|
||||||
|
jsonify,
|
||||||
|
render_template,
|
||||||
|
request,
|
||||||
|
session,
|
||||||
|
url_for,
|
||||||
|
)
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from werkzeug.utils import redirect
|
from werkzeug.utils import redirect
|
||||||
|
|
||||||
@@ -282,17 +291,19 @@ def inbox_download(service_id):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@main.route('/get-timezone', methods=['POST', 'GET'])
|
|
||||||
|
@main.route("/get-timezone", methods=["POST", "GET"])
|
||||||
def get_timezone():
|
def get_timezone():
|
||||||
print(hilite("ENTER GET-TIMEZONE"))
|
print(hilite("ENTER GET-TIMEZONE"))
|
||||||
timezone = request.cookies.get('timezone', 'UTC')
|
timezone = request.cookies.get("timezone", "UTC")
|
||||||
print(hilite(f"TIMEZONE {timezone}"))
|
print(hilite(f"TIMEZONE {timezone}"))
|
||||||
#data = request.get_json()
|
# data = request.get_json()
|
||||||
#print(f"HEY DATA WAS {data}")
|
# print(f"HEY DATA WAS {data}")
|
||||||
#timezone = data.get('timezone')
|
# timezone = data.get('timezone')
|
||||||
#print(hilite(f"TIMEZONE = {timezone}"))
|
# print(hilite(f"TIMEZONE = {timezone}"))
|
||||||
#session['timezone'] = timezone
|
# session['timezone'] = timezone
|
||||||
return jsonify({'message': f'Timezone get successfully {timezone}'}), 200
|
return jsonify({"message": f"Timezone get successfully {timezone}"}), 200
|
||||||
|
|
||||||
|
|
||||||
def get_inbox_partials(service_id):
|
def get_inbox_partials(service_id):
|
||||||
page = int(request.args.get("page", 1))
|
page = int(request.args.get("page", 1))
|
||||||
@@ -415,7 +426,7 @@ def get_dashboard_partials(service_id):
|
|||||||
|
|
||||||
def get_dashboard_totals(statistics):
|
def get_dashboard_totals(statistics):
|
||||||
|
|
||||||
timezone = request.cookies.get('timezone', 'UTC')
|
timezone = request.cookies.get("timezone", "UTC")
|
||||||
print(hilite(f"HURRAY TIMEZONE IS {timezone}"))
|
print(hilite(f"HURRAY TIMEZONE IS {timezone}"))
|
||||||
if current_user.preferred_timezone is not timezone:
|
if current_user.preferred_timezone is not timezone:
|
||||||
current_user.update(preferred_timezone=timezone)
|
current_user.update(preferred_timezone=timezone)
|
||||||
|
|||||||
Reference in New Issue
Block a user