Skip to content

Commit

Permalink
Merge pull request #2967 from dodona-edu/teacher-name-default-creatin…
Browse files Browse the repository at this point in the history
…g-course

Set current user's name as default value when creating a course
  • Loading branch information
bmesuere authored Aug 10, 2021
2 parents 4976abe + 914f914 commit fde1d35
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/controllers/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ def new
@course = Course.new(
name: @copy_options[:base].name,
description: @copy_options[:base].description,
institution: @copy_options[:base].institution,
institution: current_user.institution,
visibility: @copy_options[:base].visibility,
registration: @copy_options[:base].registration,
teacher: @copy_options[:base].teacher
teacher: current_user.full_name
)
@copy_options = {
admins: current_user.course_admin?(@copy_options[:base]),
Expand All @@ -75,7 +75,10 @@ def new
}.merge(@copy_options).symbolize_keys
else
@copy_options = nil
@course = Course.new(institution: current_user.institution)
@course = Course.new(
teacher: current_user.full_name,
institution: current_user.institution
)
end

@title = I18n.t('courses.new.title')
Expand Down

0 comments on commit fde1d35

Please sign in to comment.