Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit d66f7e9

Browse files
MCKIN-24786 (#308)
1 parent c46d1f3 commit d66f7e9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

edx_solutions_api_integration/imports/views.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def existing(self, request):
5050
data = self._validate_data(request, errors, new=False)
5151

5252
if not errors:
53-
self._enroll_user(data, errors)
53+
self._enroll_user(data, errors, response=response)
5454

5555
response.update({'errors': errors})
5656
return Response(response)
@@ -185,7 +185,7 @@ def _create_user(self, data, errors, response):
185185
except Exception as exc:
186186
self._add_error(errors, str(exc.message), _('Enrolling Participant in Company'), email)
187187

188-
def _enroll_user(self, data, errors):
188+
def _enroll_user(self, data, errors, response={}):
189189
"""Enroll user in a course and add him to a cohort."""
190190
user = data.get('user_object')
191191
email = user.email
@@ -227,6 +227,9 @@ def _enroll_user(self, data, errors):
227227
permission_groups.user_set.add(user.id)
228228
except Exception as exc:
229229
self._add_error(errors, str(exc.message), _("Setting Participant's Status"), email)
230+
else:
231+
response['user_id'] = user.id
232+
AUDIT_LOG.info(u"API::User updated with user-id - {0}".format(user.id))
230233

231234
@staticmethod
232235
def _add_error(errors, reason, activity, email):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='api-integration',
8-
version='4.1.3',
8+
version='4.1.4',
99
description='RESTful api integration for edX platform',
1010
long_description=open('README.rst').read(),
1111
author='edX',

0 commit comments

Comments
 (0)