Commit 506810f5 by Bill Filler

make model unique on partner/uuid combo, fix the update_or_create call in helper

parent 8465b132
......@@ -83,7 +83,8 @@ class EcommerceJournalDataLoader():
journal=title, sku=sku, partner=self.partner
)
logger.info(msg)
Journal.objects.update_or_create(defaults=defaults)
results = Journal.objects.update_or_create(partner=self.partner, uuid=journal_uuid, defaults=defaults)
logger.info('results from update_or_create %s', results)
return sku
def delete_journals(self):
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-03-22 01:21
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20171004_1133'),
('journal', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='journal',
options={},
),
migrations.AlterUniqueTogether(
name='journal',
unique_together=set([('partner', 'key'), ('partner', 'uuid')]),
),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment