Skip to content

Commit

Permalink
Merge branch 'master' into hu/ent-7323
Browse files Browse the repository at this point in the history
  • Loading branch information
brobro10000 committed Jul 12, 2023
2 parents 6ab8b81 + 6c9bef5 commit fb623d2
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 304 deletions.
13 changes: 8 additions & 5 deletions license_manager/apps/subscriptions/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)
from license_manager.apps.subscriptions.utils import (
localized_utcnow,
verify_salesforce_opportunity_product_line_item,
verify_sf_opportunity_product_line_item,
)


Expand Down Expand Up @@ -149,9 +149,12 @@ def is_valid(self):
)
return False

if product.plan_type.sf_id_required and \
self.cleaned_data.get('salesforce_opportunity_line_item') is None or \
not verify_salesforce_opportunity_product_line_item(self.cleaned_data.get('salesforce_opportunity_line_item')):
if (
product.plan_type.sf_id_required
and self.cleaned_data.get('salesforce_opportunity_line_item') is None
or not verify_sf_opportunity_product_line_item(self.cleaned_data.get(
'salesforce_opportunity_line_item'))
):
self._log_validation_error('no SF ID')
self.add_error(
'salesforce_opportunity_line_item',
Expand Down Expand Up @@ -226,7 +229,7 @@ def is_valid(self):
return False

if form_future_salesforce_opportunity_line_item is None or \
not verify_salesforce_opportunity_product_line_item(form_future_salesforce_opportunity_line_item):
not verify_sf_opportunity_product_line_item(form_future_salesforce_opportunity_line_item):
self.add_error(
'salesforce_opportunity_id',
'You must specify Salesforce ID for the renewed product. It must start with \'00k\'.',
Expand Down
1 change: 0 additions & 1 deletion license_manager/apps/subscriptions/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def make_bound_subscription_plan_renewal_form(
'salesforce_opportunity_id': salesforce_opportunity_id,
'license_types_to_copy': license_types_to_copy,
}
print(form_data)
return SubscriptionPlanRenewalForm(form_data)


Expand Down
2 changes: 1 addition & 1 deletion license_manager/apps/subscriptions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_subsidy_checksum(lms_user_id, course_key, license_uuid):
return b64encode(digest).decode()


def verify_salesforce_opportunity_product_line_item(salesforce_opportunity_line_item):
def verify_sf_opportunity_product_line_item(salesforce_opportunity_line_item):
"""
Returns boolean value to confirm if the passed salesforce_opportunity_line_item format
is correct
Expand Down
50 changes: 17 additions & 33 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ backports-zoneinfo[tzdata]==0.2.1
# kombu
billiard==4.1.0
# via celery
boto3==1.26.153
boto3==1.27.0
# via django-ses
botocore==1.29.153
botocore==1.30.0
# via
# boto3
# s3transfer
celery==5.3.0
celery==5.3.1
# via
# -r requirements/base.in
# django-celery-results
Expand All @@ -53,16 +53,10 @@ click-didyoumean==0.3.0
# via celery
click-plugins==1.1.1
# via celery
click-repl==0.2.0
click-repl==0.3.0
# via celery
code-annotations==1.3.0
# via edx-toggles
coreapi==2.3.3
# via drf-yasg
coreschema==0.0.4
# via
# coreapi
# drf-yasg
cryptography==41.0.1
# via
# pyjwt
Expand All @@ -71,7 +65,7 @@ defusedxml==0.7.1
# via
# python3-openid
# social-auth-core
django==3.2.19
django==3.2.20
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -148,7 +142,7 @@ drf-jwt==1.19.2
# via edx-drf-extensions
drf-nested-routers==0.93.4
# via -r requirements/base.in
drf-yasg==1.21.5
drf-yasg==1.21.6
# via edx-api-doc-tools
edx-api-doc-tools==1.6.0
# via -r requirements/base.in
Expand Down Expand Up @@ -180,27 +174,23 @@ idna==3.4
# via requests
inflection==0.5.1
# via drf-yasg
itypes==1.2.0
# via coreapi
jinja2==3.1.2
# via
# code-annotations
# coreschema
# via code-annotations
jmespath==1.0.1
# via
# boto3
# botocore
jsonfield==3.1.0
# via edx-celeryutils
kombu==5.3.0
kombu==5.3.1
# via celery
markupsafe==2.1.3
# via jinja2
monotonic==1.6
# via analytics-python
mysqlclient==2.1.1
mysqlclient==2.2.0
# via -r requirements/base.in
newrelic==8.8.0
newrelic==8.8.1
# via edx-django-utils
oauthlib==3.2.2
# via
Expand All @@ -212,7 +202,7 @@ pbr==5.11.1
# via stevedore
ply==3.11
# via djangoql
prompt-toolkit==3.0.38
prompt-toolkit==3.0.39
# via click-repl
psutil==5.9.5
# via edx-django-utils
Expand Down Expand Up @@ -247,24 +237,21 @@ pytz==2023.3
# djangorestframework
# drf-yasg
pyyaml==6.0
# via code-annotations
redis==4.5.5
# via
# code-annotations
# drf-yasg
redis==4.6.0
# via -r requirements/base.in
requests==2.31.0
# via
# analytics-python
# coreapi
# edx-drf-extensions
# edx-rest-api-client
# requests-oauthlib
# slumber
# social-auth-core
requests-oauthlib==1.3.1
# via social-auth-core
ruamel-yaml==0.17.31
# via drf-yasg
ruamel-yaml-clib==0.2.7
# via ruamel-yaml
rules==3.3
# via -r requirements/base.in
s3transfer==0.6.1
Expand All @@ -276,7 +263,6 @@ simplejson==3.19.1
six==1.16.0
# via
# analytics-python
# click-repl
# djangorestframework-csv
# edx-auth-backends
# edx-drf-extensions
Expand All @@ -299,7 +285,7 @@ stevedore==5.1.0
# edx-opaque-keys
text-unidecode==1.3
# via python-slugify
typing-extensions==4.6.3
typing-extensions==4.7.1
# via
# asgiref
# kombu
Expand All @@ -310,9 +296,7 @@ tzdata==2023.3
unicodecsv==0.14.1
# via djangorestframework-csv
uritemplate==4.1.1
# via
# coreapi
# drf-yasg
# via drf-yasg
urllib3==1.26.16
# via
# botocore
Expand Down
5 changes: 0 additions & 5 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ django-simple-history==3.0.0
# tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos.
# Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810
tox<4.0.0

# edx-sphinx-theme is not compatible with latest Sphinx==6.0.0 version
# Pinning Sphinx version unless the compatibility issue gets resolved
# For details, see issue https://github.com/openedx/edx-sphinx-theme/issues/197
sphinx<6.0.0
Loading

0 comments on commit fb623d2

Please sign in to comment.