Skip to content

Commit 62c0607

Browse files
authored
Updated view when a course cannot be created via an LTI external tool (#7669)
1 parent b9d27d5 commit 62c0607

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### ✨ New features and improvements
88
- Added new loading spinner icon for tables (#7602)
9+
- Update message and page displaying cannot create new course via external LTI tool (#7669)
910

1011
### 🐛 Bug fixes
1112
- Resque Host Authorization, removing env condition as this is for all environments (#7671)

app/controllers/lti_deployments_controller.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,12 @@ def check_host
183183

184184
def create_course
185185
if LtiConfig.respond_to?(:allowed_to_create_course?) && !LtiConfig.allowed_to_create_course?(record)
186-
render 'shared/http_status',
187-
locals: { code: '422',
188-
message: format(Settings.lti.unpermitted_new_course_message,
189-
course_name: record.lms_course_name) },
190-
status: :unprocessable_entity, layout: false
186+
@title = I18n.t('lti.course_creation_denied')
187+
@message = format(
188+
Settings.lti.unpermitted_new_course_message,
189+
course_name: record.lms_course_name
190+
)
191+
render 'message', status: :forbidden
191192
return
192193
end
193194

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<section id='content'>
2+
<h1><%= @title %></h1>
3+
<p><%= @message %></p>
4+
</section>

config/locales/common/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ en:
2222
help: Help
2323
lti:
2424
config_error: Error configuring LTI.
25+
course_creation_denied: Course Creation Not Allowed
2526
course_exists: A course with this name already exists on MarkUs. Please select a course to link to.
2627
course_link_error: Unsuccessful. Please relaunch MarkUs from your LMS.
2728
course_link_success: Success. %{markus_course_name} is now linked with your LMS.

spec/controllers/lti_deployments_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151

152152
it 'responds with an error message' do
153153
post_as instructor, :create_course, params: course_params
154-
expect(response).to have_http_status(:unprocessable_entity)
154+
expect(response).to have_http_status(:forbidden)
155155
end
156156
end
157157
end

0 commit comments

Comments
 (0)