Skip to content

Commit

Permalink
feat: add coursecreator option to django model
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
johanseto committed Aug 18, 2022
1 parent e08be24 commit 2f775a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cms/djangoapps/course_creators/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}),
Expand All @@ -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
Expand Down

0 comments on commit 2f775a7

Please sign in to comment.