changed the wrong model :(

This commit is contained in:
Thomas Steen Rasmussen 2017-04-08 11:04:39 +02:00
parent e4e5688e3c
commit 8a318400ae
3 changed files with 30 additions and 3 deletions

View file

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-08 09:04
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0040_auto_20170408_1055'),
]
operations = [
migrations.AlterField(
model_name='coinifyapicallback',
name='payload',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=''),
preserve_default=False,
),
migrations.AlterField(
model_name='epaycallback',
name='payload',
field=django.contrib.postgres.fields.jsonb.JSONField(),
),
]

View file

@ -309,7 +309,7 @@ class EpayCallback(CreatedUpdatedModel, UUIDModel):
verbose_name_plural = 'Epay Callbacks' verbose_name_plural = 'Epay Callbacks'
ordering = ['-created'] ordering = ['-created']
payload = JSONField(blank=True) payload = JSONField()
md5valid = models.BooleanField(default=False) md5valid = models.BooleanField(default=False)
def __str__(self): def __str__(self):
@ -410,7 +410,7 @@ class CoinifyAPIInvoice(CreatedUpdatedModel):
class CoinifyAPICallback(CreatedUpdatedModel): class CoinifyAPICallback(CreatedUpdatedModel):
headers = JSONField() headers = JSONField()
payload = JSONField(null=True) payload = JSONField(blank=True)
body = models.TextField(default='') body = models.TextField(default='')
order = models.ForeignKey('shop.Order') order = models.ForeignKey('shop.Order')
valid = models.BooleanField(default=False) valid = models.BooleanField(default=False)

View file

@ -605,7 +605,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
try: try:
parsed = json.loads(str(request.body)) parsed = json.loads(str(request.body))
except Exception as E: except Exception as E:
parsed = None parsed = ''
# save callback to db # save callback to db
callbackobject = CoinifyAPICallback.objects.create( callbackobject = CoinifyAPICallback.objects.create(