[System] Fixed some minor python warnings
This commit is contained in:
parent
791656147e
commit
ed361a7361
|
@ -55,7 +55,6 @@ coverage.xml
|
|||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from flask import url_for
|
||||
from typing import Optional, Type
|
||||
from typing import Optional
|
||||
from datetime import date, datetime
|
||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Credit -> to account
|
||||
|
||||
from sqlalchemy import func
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
from werkzeug.exceptions import BadRequest, NotFound, Conflict
|
||||
|
||||
from flaschengeist.database import db
|
||||
|
@ -12,7 +12,6 @@ from flaschengeist.models.user import User
|
|||
|
||||
from .models import Transaction
|
||||
from . import permissions
|
||||
from ... import logger
|
||||
|
||||
__attribute_limit = "balance_limit"
|
||||
|
||||
|
@ -41,7 +40,9 @@ def get_balance(user, start: datetime = None, end: datetime = None):
|
|||
|
||||
def get_balances(start: datetime = None, end: datetime = None):
|
||||
debit = db.session.query(Transaction.sender_id, func.sum(Transaction.amount)).filter(Transaction.sender_ != None)
|
||||
credit = db.session.query(Transaction.receiver_id, func.sum(Transaction.amount)).filter(Transaction.receiver_ != None)
|
||||
credit = db.session.query(Transaction.receiver_id, func.sum(Transaction.amount)).filter(
|
||||
Transaction.receiver_ != None
|
||||
)
|
||||
if start:
|
||||
debit = debit.filter(start <= Transaction.time)
|
||||
credit = credit.filter(start <= Transaction.time)
|
||||
|
|
|
@ -28,7 +28,7 @@ class MailMessagePlugin(Plugin):
|
|||
def send_mail(self, msg: Message):
|
||||
if isinstance(msg.receiver, User):
|
||||
if not msg.receiver.mail:
|
||||
logger.warn("Could not send Mail, mail missing: {}".format(msg.receiver))
|
||||
logger.warning("Could not send Mail, mail missing: {}".format(msg.receiver))
|
||||
return
|
||||
recipients = [msg.receiver.mail]
|
||||
else:
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
import inspect
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
import pkg_resources
|
||||
from werkzeug.middleware.dispatcher import DispatcherMiddleware
|
||||
|
||||
from flaschengeist.config import config
|
||||
|
||||
|
|
Loading…
Reference in New Issue