Wrapping the import of FPS keys in amazon.py so that things won't die if it gets imported before the database gets set up -- these changes don't break amazon functionality on ry's laptop and hopefully will be ok for jenkins.

pull/1/head
Raymond Yee 2012-05-10 08:08:58 -07:00
parent 069342276b
commit 9aa586181e
2 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,4 @@
from regluit.payment.parameters import *
from regluit.core.models import Key
from django.core.urlresolvers import reverse
from django.conf import settings
from regluit.payment.models import Transaction, PaymentResponse
@ -50,10 +49,15 @@ AMAZON_OPERATION_TYPE_PAY = 'PAY'
AMAZON_OPERATION_TYPE_REFUND = 'REFUND'
AMAZON_OPERATION_TYPE_CANCEL = 'CANCEL'
# load FPS_ACCESS_KEY and FPS_SECRET_KEY from the database
# load FPS_ACCESS_KEY and FPS_SECRET_KEY from the database if possible
FPS_ACCESS_KEY = Key.objects.get(name="FPS_ACCESS_KEY").value
FPS_SECRET_KEY = Key.objects.get(name="FPS_SECRET_KEY").value
try:
from regluit.core.models import Key
FPS_ACCESS_KEY = Key.objects.get(name="FPS_ACCESS_KEY").value
FPS_SECRET_KEY = Key.objects.get(name="FPS_SECRET_KEY").value
except:
FPS_ACCESS_KEY = ''
FPS_SECRET_KEY = ''
def ProcessIPN(request):

View File

@ -22,6 +22,7 @@ DATABASES = {
'PASSWORD': 'forgetn0t',
'HOST': 'justdb.cboagmr25pjs.us-east-1.rds.amazonaws.com',
'PORT': '',
'TEST_CHARSET': 'utf8'
}
}