mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
Bugfixes, refactoring
This commit is contained in:
parent
54465725af
commit
ca48a0f0ed
9 changed files with 18 additions and 48 deletions
|
@ -4,7 +4,6 @@ import requests
|
|||
from requests.auth import HTTPDigestAuth
|
||||
|
||||
import settings
|
||||
from funding.orm.orm import User
|
||||
|
||||
|
||||
class Daemon:
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import os
|
||||
import json
|
||||
from datetime import datetime, date
|
||||
|
||||
import pyqrcode
|
||||
import requests
|
||||
from flask import g, request
|
||||
from flask.json import JSONEncoder
|
||||
from flask import request
|
||||
|
||||
import settings
|
||||
from funding.factory import cache
|
||||
|
@ -14,7 +10,7 @@ from funding.factory import cache
|
|||
def json_encoder(obj):
|
||||
if isinstance(obj, (datetime, date)):
|
||||
return obj.isoformat()
|
||||
raise TypeError ("Type %s not serializable" % type(obj))
|
||||
raise TypeError("Type %s not serializable" % type(obj))
|
||||
|
||||
|
||||
class Summary:
|
||||
|
@ -30,7 +26,7 @@ class Summary:
|
|||
@cache.cached(timeout=600, key_prefix="funding_stats")
|
||||
def fetch_stats():
|
||||
from funding.factory import db
|
||||
from funding.orm.orm import Proposal, User, Comment
|
||||
from funding.orm import Proposal, User
|
||||
|
||||
data = {}
|
||||
categories = settings.FUNDING_CATEGORIES
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
from datetime import datetime
|
||||
from flask import session, g, request
|
||||
from flask import request
|
||||
import settings
|
||||
from funding.bin.utils import Summary
|
||||
from funding.factory import app, db
|
||||
from funding.orm.orm import Proposal, User, Comment
|
||||
from funding.orm import User, Comment
|
||||
|
||||
|
||||
@app.context_processor
|
||||
|
@ -41,11 +40,6 @@ def after_request(res):
|
|||
return res
|
||||
|
||||
|
||||
@app.teardown_appcontext
|
||||
def shutdown_session(**kwargs):
|
||||
db.session.remove()
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def error(err):
|
||||
return 'Error', 404
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue