Jlc/add cms support for admin and course creator#2
Conversation
fb9517d to
3600012
Compare
This allow modify the course creator model admin using the eox-nelp plugin. This change add the possibilty to add or delete course creator from admin.
Due course_creators is an studio app, when lms use `eox_nelp` it bring an error. This avoid the following error ```RuntimeError: Model class cms.djangoapps.course_creators.models.CourseCreator doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS```. So you have to add this one in the `INSTALLED_APPS`.
f98aeb6 to
edd5ed2
Compare
| @@ -0,0 +1,23 @@ | |||
| """Backend for course_creators module. | |||
There was a problem hiding this comment.
the convention is file_name_{first letter of the version}_v1.py so for this case this should be course_creators_k_v1.py
There was a problem hiding this comment.
They didn't test eox-core with koa so I think that is the reason. Anyway you can not ensure that this backend will work in lilac therefore you should set the name with the version that you use
There was a problem hiding this comment.
OK, you have a good point. Let me change it.
| def has_add_permission(self, request): | ||
| return True | ||
| def has_delete_permission(self, request, obj=None): | ||
| return True |
There was a problem hiding this comment.
| def has_add_permission(self, request): | |
| return True | |
| def has_delete_permission(self, request, obj=None): | |
| return True | |
| def has_add_permission(self, request): | |
| return True | |
| def has_delete_permission(self, request, obj=None): | |
| return True |
eox_nelp/admin/course_creators.py
Outdated
| classes: | ||
| nelpCourseCreatorAdmin: EoxNelp CourseCreators admin class. | ||
| """ | ||
| from __future__ import absolute_import |
There was a problem hiding this comment.
generally we use this in applications that has support for python 2 and 3, this is just for python 3 so do you need this for something else ?
There was a problem hiding this comment.
No, I think no cause we are using python3, I will remove it.
| This contains all the required dependencies from course_creators. | ||
| Attributes: | ||
| backend:Imported ccx module by using the plugin settings. | ||
| CourseCreator: Wrapper courseCreator model. |
There was a problem hiding this comment.
| CourseCreator: Wrapper courseCreator model. | |
| CourseCreator: Wrapper CourseCreator model. |
| """Wrapper course_creator module file. | ||
| This contains all the required dependencies from course_creators. | ||
| Attributes: | ||
| backend:Imported ccx module by using the plugin settings. |
eox_nelp/apps.py
Outdated
| class EoxNelpCMSConfig(AppConfig): | ||
| """App configuration""" | ||
| name = 'eox_nelp' | ||
| verbose_name = "eduNEXT Openedx Extensions" |
There was a problem hiding this comment.
I'm not sure about this
There was a problem hiding this comment.
@andrey-canon what is the problem? THe name???
There was a problem hiding this comment.
this could be Nelp Openedx Extension since "eduNEXT Openedx Extensions" is eox-core
There was a problem hiding this comment.
Ah ok heheh let me I change it.
eox_nelp/admin/course_creators.py
Outdated
|
|
||
|
|
||
| class NelpCourseCreatorAdmin(CourseCreatorAdmin): | ||
| """EoxSupport CertificateTemplate admin class. |
There was a problem hiding this comment.
EoxSupport? CertificateTemplate ?
eox_nelp/admin/course_creators.py
Outdated
| @@ -0,0 +1,36 @@ | |||
| """courseCreators admin file. | |||
There was a problem hiding this comment.
| """courseCreators admin file. | |
| """CourseCreators admin file. |
eox_nelp/admin/course_creators.py
Outdated
| """courseCreators admin file. | ||
| Contains all the nelped admin models for course_creators. | ||
| classes: | ||
| nelpCourseCreatorAdmin: EoxNelp CourseCreators admin class. |
There was a problem hiding this comment.
| nelpCourseCreatorAdmin: EoxNelp CourseCreators admin class. | |
| NelpCourseCreatorAdmin: EoxNelp CourseCreators admin class. |
Due this backend was backend was tested in koa it could add uncertainty affirm that would work in lilac too.

Description
This is related to the requirement of Nelp that is creating users but need to give course creator permissions.
The problem is that until the user login, the user will not appear in the course-creator table.
https://github.com/eduNEXT/edx-platform/blob/master/cms/djangoapps/contentstore/views/course.py#L1889-L1893
So this PR adds the option to add course creator directly from the admin model matching with the username of the user model.
Development
This is a remake of eduNEXT/edx-platform#269 using the
eox-nelpplugin.Configuration
Remember to configure you have to update your
cms/env/devstack.pyor your custom settings.FEATURES['ENABLE_CREATOR_GROUP'] = True.Note: Is already in stage environment to check.
https://studio.stage.nelp.gov.sa/admin/course_creators/coursecreator/add/
Jira story
https://edunext.atlassian.net/browse/NELP-195?atlOrigin=eyJpIjoiNmFmOTc4YTk4NDczNGZiZGEwZjA2YzY5MjdlYzljNjQiLCJwIjoiaiJ9
Before
After