-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11503 from edx/coupons/otto-checkout
Checkout on Otto
- Loading branch information
Showing
15 changed files
with
322 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
""" Admin site bindings for commerce app. """ | ||
|
||
from django.contrib import admin | ||
|
||
from commerce.models import CommerceConfiguration | ||
from config_models.admin import ConfigurationModelAdmin | ||
|
||
admin.site.register(CommerceConfiguration, ConfigurationModelAdmin) |
32 changes: 32 additions & 0 deletions
32
lms/djangoapps/commerce/migrations/0002_commerceconfiguration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
from django.conf import settings | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('commerce', '0001_data__add_ecommerce_service_user'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='CommerceConfiguration', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), | ||
('enabled', models.BooleanField(default=False, verbose_name='Enabled')), | ||
('checkout_on_ecommerce_service', models.BooleanField(default=False, help_text='Use the checkout page hosted by the E-Commerce service.')), | ||
('single_course_checkout_page', models.CharField(default=b'/basket/single-item/', help_text='Path to single course checkout page hosted by the E-Commerce service.', max_length=255)), | ||
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), | ||
], | ||
options={ | ||
'ordering': ('-change_date',), | ||
'abstract': False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
""" | ||
This file is intentionally empty. Django 1.6 and below require a models.py file for all apps. | ||
Commerce-related models. | ||
""" | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from config_models.models import ConfigurationModel | ||
|
||
|
||
class CommerceConfiguration(ConfigurationModel): | ||
""" Commerce configuration """ | ||
|
||
checkout_on_ecommerce_service = models.BooleanField( | ||
default=False, | ||
help_text=_('Use the checkout page hosted by the E-Commerce service.') | ||
) | ||
|
||
single_course_checkout_page = models.CharField( | ||
max_length=255, | ||
default='/basket/single-item/', | ||
help_text=_('Path to single course checkout page hosted by the E-Commerce service.') | ||
) | ||
|
||
def __unicode__(self): | ||
return "Commerce configuration" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.