Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
506810f5
Commit
506810f5
authored
Mar 21, 2018
by
Bill Filler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make model unique on partner/uuid combo, fix the update_or_create call in helper
parent
8465b132
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletions
+26
-1
course_discovery/apps/journal/data_loaders/helpers.py
+2
-1
course_discovery/apps/journal/migrations/0002_auto_20180322_0121.py
+24
-0
No files found.
course_discovery/apps/journal/data_loaders/helpers.py
View file @
506810f5
...
...
@@ -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
):
...
...
course_discovery/apps/journal/migrations/0002_auto_20180322_0121.py
0 → 100644
View file @
506810f5
# -*- 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'
)]),
),
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment