Skip to content

Commit

Permalink
Merge branch 'master' into repo-tools/upgrade-python-requirements-68f…
Browse files Browse the repository at this point in the history
…e7ab
  • Loading branch information
brobro10000 authored Jul 15, 2024
2 parents 778e72c + 6537c7a commit 41470f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions license_manager/apps/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ class EnterpriseEnrollmentWithLicenseSubsidyQueryParamsSerializer(serializers.Se
)
enroll_all = serializers.BooleanField(
required=False,
allow_null=True,
help_text='A boolean indicating whether to enroll all learners or not',
)
subscription_uuid = serializers.UUIDField(
Expand All @@ -717,8 +718,8 @@ class Meta:
]

def validate(self, attrs):
if attrs.get('enroll_all') and not attrs.get('subscription_uuid'):
raise serializers.ValidationError({'subscription_id': 'This field is required when enroll_all is True.'})
if attrs.get('enroll_all') is not None and not attrs.get('subscription_uuid'):
raise serializers.ValidationError({'subscription_id': 'This field is required when enroll_all is provided'})
return attrs


Expand Down
2 changes: 1 addition & 1 deletion license_manager/apps/api/v1/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4096,7 +4096,7 @@ def test_bulk_licensed_enrollment_with_enroll_all_no_sub_uuid(self):
url = self._get_url_with_params(enroll_all=True)
response = self.api_client.post(url, data)
assert response.status_code == 400
expected_json = {'subscription_id': ['This field is required when enroll_all is True.']}
expected_json = {'subscription_id': ['This field is required when enroll_all is provided']}
assert response.json() == expected_json

def test_bulk_licensed_enrollment_with_missing_emails(self):
Expand Down
2 changes: 1 addition & 1 deletion license_manager/apps/subscriptions/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class SegmentEvents:

# Bulk operation constants
LICENSE_BULK_OPERATION_BATCH_SIZE = 100
PENDING_ACCOUNT_CREATION_BATCH_SIZE = 100
PENDING_ACCOUNT_CREATION_BATCH_SIZE = 50
LICENSE_SOURCE_BULK_OPERATION_BATCH_SIZE = 100
TRACK_LICENSE_CHANGES_BATCH_SIZE = 25
ASSIGNMENT_EMAIL_BATCH_SIZE = 50
Expand Down

0 comments on commit 41470f2

Please sign in to comment.