Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
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
ecommerce
Commits
dfc46050
Commit
dfc46050
authored
Jan 23, 2018
by
Michael LoTurco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add truncation for too-long offernames
Learner-3936
parent
0dc818b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
ecommerce/extensions/order/utils.py
+1
-3
ecommerce/programs/forms.py
+3
-0
ecommerce/theming/management/commands/create_sites_and_partners.py
+0
-1
No files found.
ecommerce/extensions/order/utils.py
View file @
dfc46050
...
...
@@ -4,15 +4,13 @@ from __future__ import unicode_literals
import
logging
import
waffle
from
django.conf
import
settings
from
django.core.cache
import
cache
from
edx_rest_api_client.client
import
EdxRestApiClient
from
edx_rest_api_client.exceptions
import
HttpNotFoundError
from
oscar.apps.order.utils
import
OrderCreator
as
OscarOrderCreator
from
oscar.core.loading
import
get_model
from
requests.exceptions
import
ConnectionError
,
ConnectTimeout
# pylint: disable=ungrouped-imports
from
requests.exceptions
import
ConnectionError
,
ConnectTimeout
# pylint: disable=ungrouped-imports
from
threadlocals.threadlocals
import
get_current_request
from
ecommerce.core.url_utils
import
get_lms_entitlement_api_url
...
...
ecommerce/programs/forms.py
View file @
dfc46050
...
...
@@ -88,6 +88,9 @@ class ProgramOfferForm(forms.ModelForm):
program_type
=
program
[
'type'
]
))
# Truncate offer_names down to 128 characters, as Oscar's AbstractConditionalOffer name is max_length 128
offer_name
=
(
offer_name
[:
125
]
+
'...'
)
if
len
(
offer_name
)
>
128
else
offer_name
# pylint: disable=unsubscriptable-object
self
.
instance
.
name
=
offer_name
self
.
instance
.
status
=
ConditionalOffer
.
OPEN
self
.
instance
.
offer_type
=
ConditionalOffer
.
SITE
...
...
ecommerce/theming/management/commands/create_sites_and_partners.py
View file @
dfc46050
...
...
@@ -13,7 +13,6 @@ from oscar.core.loading import get_model
from
ecommerce.core.models
import
SiteConfiguration
from
ecommerce.theming.models
import
SiteTheme
logger
=
logging
.
getLogger
(
__name__
)
Partner
=
get_model
(
'partner'
,
'Partner'
)
...
...
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