From 2f775a794bc946beb0a94f6e1bd1ddd2a9e45f09 Mon Sep 17 00:00:00 2001 From: johanv26 Date: Thu, 18 Aug 2022 17:14:27 -0500 Subject: [PATCH] feat: add coursecreator option to django model With this change is possible add coursecreator without needing a login in cms for the user. The add option is matched with the field username of the user model. --- cms/djangoapps/course_creators/admin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/course_creators/admin.py b/cms/djangoapps/course_creators/admin.py index 9f8e2ae494ef..672484ed9252 100644 --- a/cms/djangoapps/course_creators/admin.py +++ b/cms/djangoapps/course_creators/admin.py @@ -72,9 +72,9 @@ class CourseCreatorAdmin(admin.ModelAdmin): # Fields to display on the overview page. list_display = ['username', get_email, 'state', 'state_changed', 'note', 'all_organizations'] filter_horizontal = ('organizations',) - readonly_fields = ['username', 'state_changed'] + readonly_fields = ['state_changed'] # Controls the order on the edit form (without this, read-only fields appear at the end). - fieldsets = ( + add_fieldsets = ( (None, { 'fields': ['username', 'state', 'state_changed', 'note', 'all_organizations', 'organizations'] }), @@ -98,7 +98,7 @@ def username(self, inst): username.admin_order_field = 'user__username' def has_add_permission(self, request): - return False + return True def has_delete_permission(self, request, obj=None): return False