Switch to using modeldict for all PAC settings

This commit is contained in:
2012-04-29 19:35:55 +01:00
parent c6e8a22dd7
commit 192f3a179e
2 changed files with 4 additions and 5 deletions

View File

@@ -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

View File

@@ -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)):