diff --git a/pacmanager/core/models.py b/pacmanager/core/models.py index 2efd09b..4d3827a 100644 --- a/pacmanager/core/models.py +++ b/pacmanager/core/models.py @@ -4,7 +4,6 @@ from uuid import uuid4 import logging from eveapi import EVEAPIConnection, Error -from django.conf import settings from django.db import models from django.utils.timezone import utc from django.contrib.auth.models import User @@ -57,8 +56,9 @@ class MonthTotal(models.Model): @property def fees_due(self): - threshold = getattr(settings, 'PAC_TAX_THRESHOLD', Decimal('200000000')) - calc = (self.tax / self.corporation.tax_rate) * getattr(settings, 'PAC_TAX_RATE', 10) + from .conf import managerconf + threshold = Decimal(managerconf.get('pac.tax_threshold', '200000000')) + calc = (self.tax / self.corporation.tax_rate) * int(managerconf.get('pac.tax_rate', '10')) if calc > threshold: return round(calc, 2) return threshold diff --git a/pacmanager/core/tasks.py b/pacmanager/core/tasks.py index 75f1e87..346c227 100644 --- a/pacmanager/core/tasks.py +++ b/pacmanager/core/tasks.py @@ -1,7 +1,6 @@ import logging from datetime import datetime from decimal import Decimal -from django.conf import settings from django.utils.timezone import utc from eveapi import EVEAPIConnection, Error, Rowset @@ -39,7 +38,7 @@ def import_wallet_journal(corporation_id): totals = {} for record in rows: if int(record.refID) > corp.last_transaction: - if int(record.refTypeID) in getattr(settings, 'PAC_TAX_REFIDS', [85, 99]): + if int(record.refTypeID) in [int(x.trim()) for x in managerconf.get('pac.tax_refids', '85,99').split(',')]: #print record.refID, int(record.refTypeID), record.amount dt = datetime.fromtimestamp(record.date).replace(tzinfo=utc) if not totals.has_key('%s-%s' % (dt.year, dt.month)):