scrub commas from user names sent to crocodoc, fixes #11137
crocodoc does not allow viewing sessions to be created when the user name sent to crocodoc has a comma, we need to scrub it out. test-plan: * as a student, submit a crocodocable file as a submission * change the teacher short name(display name) to have a comma * make annotations on the student submission as the teacher * view teacher annotations as the student * during both viewing sessions, the teacher's name on the annotiations should not have a comma Change-Id: Iebfc7f8137ea8e49fef139fdfec932bdb464d85d Reviewed-on: https://gerrit.instructure.com/14208 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Jon Jensen <jon@instructure.com>
This commit is contained in:
parent
252d35688c
commit
a9b83fea43
|
@ -2571,7 +2571,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def crocodoc_user
|
||||
"#{crocodoc_id!},#{short_name}"
|
||||
"#{crocodoc_id!},#{short_name.gsub(",","")}"
|
||||
end
|
||||
|
||||
# mfa settings for a user are the most restrictive of any pseudonyms the user has
|
||||
|
|
|
@ -1886,6 +1886,12 @@ describe User do
|
|||
@user.crocodoc_user.should eql '999,Bob'
|
||||
end
|
||||
|
||||
it "should scrub commas from the user name" do
|
||||
@user.short_name = "Smith, Bob"
|
||||
@user.save!
|
||||
@user.crocodoc_user.should eql '999,Smith Bob'
|
||||
end
|
||||
|
||||
it "should not change a user's crocodoc_id" do
|
||||
@user.update_attribute :crocodoc_id, 2
|
||||
@user.crocodoc_id!.should eql 2
|
||||
|
|
Loading…
Reference in New Issue