Skip to content

Commit

Permalink
EDUCATOR-4638 | Make sure GradeCSVProcessor.user_id is not null; supe…
Browse files Browse the repository at this point in the history
…r-csv==0.9.4
  • Loading branch information
iloveagent57 committed Sep 24, 2019
1 parent b5105ca commit c11a30b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Unreleased
~~~~~~~~~~
*

[0.6.3] - 2019-09-24
~~~~~~~~~~~~~~~~~~~~~
* Upgrade super-csv to 0.9.4, make sure to pass ``user_id`` to GradeCSVProcessor.__init__().

[0.6.2] - 2019-09-23
~~~~~~~~~~~~~~~~~~~~~
* Upgrade super-csv to 0.9.3
Expand Down
2 changes: 1 addition & 1 deletion bulk_grades/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

from __future__ import absolute_import, unicode_literals

__version__ = '0.6.2'
__version__ = '0.6.3'

default_app_config = 'bulk_grades.apps.BulkGradesConfig' # pylint: disable=invalid-name
9 changes: 8 additions & 1 deletion bulk_grades/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def __init__(self, **kwargs):
self.user_id = None

# The CSVProcessor.__init__ method will set attributes on self
# from items in kwargs, so this super().__init__() call will
# from items in kwargs, so this super().__init__() call can
# override any attribute values assigned above.
super(GradeCSVProcessor, self).__init__(**kwargs)

Expand All @@ -291,6 +291,13 @@ def _user(self):
if self.user_id:
return get_user_model().objects.get(id=self.user_id)

def save(self, operation_name=None, operating_user=None):
"""
Saves the operation state for this processor, including the user
who is performing the operation.
"""
super(GradeCSVProcessor, self).save(operating_user=self._user)

def get_unique_path(self):
"""
Return a unique id for CSVOperations.
Expand Down
2 changes: 1 addition & 1 deletion bulk_grades/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def initialize_processor(self, request, course_id):
course_grade_max = request.GET.get('courseGradeMax')
self.processor = api.GradeCSVProcessor(
course_id=course_id,
_user=request.user,
user_id=request.user.id,
track=request.GET.get('track'),
cohort=request.GET.get('cohort'),
subsection=request.GET.get('assignment'),
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ requests==2.22.0
six==1.12.0 # via edx-opaque-keys, stevedore
slumber==0.7.1
stevedore==1.31.0 # via edx-opaque-keys
super-csv==0.9.3
super-csv==0.9.4
urllib3==1.25.3 # via requests
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ six==1.12.0
slumber==0.7.1
snowballstemmer==1.9.1
stevedore==1.31.0
super-csv==0.9.3
super-csv==0.9.4
text-unidecode==1.2
toml==0.10.0
tox-battery==0.5.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ snowballstemmer==1.9.1 # via sphinx
sphinx==1.8.5
sphinxcontrib-websupport==1.1.2 # via sphinx
stevedore==1.31.0
super-csv==0.9.3
super-csv==0.9.4
text-unidecode==1.2
typing==3.7.4.1 # via sphinx
urllib3==1.25.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ six==1.12.0
slumber==0.7.1
snowballstemmer==1.9.1 # via pydocstyle
stevedore==1.31.0
super-csv==0.9.3
super-csv==0.9.4
text-unidecode==1.2
urllib3==1.25.3
wcwidth==0.1.7
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ scandir==1.10.0 # via pathlib2
six==1.12.0
slumber==0.7.1
stevedore==1.31.0
super-csv==0.9.3
super-csv==0.9.4
text-unidecode==1.2 # via python-slugify
urllib3==1.25.3
wcwidth==0.1.7 # via pytest
Expand Down

0 comments on commit c11a30b

Please sign in to comment.