diff --git a/script/rvd_front b/script/rvd_front index 134e91b92..69a07501a 100644 --- a/script/rvd_front +++ b/script/rvd_front @@ -1900,12 +1900,14 @@ sub _upload_users_csv($c, $csv, $type, $create) { }; return $c->render(json => - { output => $output + { + output => $output ,error => $error ,done => 1 }) if $c->stash('req') eq 'json'; return $c->render(template => "/main/upload_users" + ,output => $output ,error => $error ,done => 1 ); diff --git a/t/mojo/60_upload.t b/t/mojo/60_upload.t index ffb5f4f6b..1a331cf4a 100644 --- a/t/mojo/60_upload.t +++ b/t/mojo/60_upload.t @@ -723,6 +723,20 @@ sub _do_test_upload_json_users_pass($mojo) { } } +sub test_upload_html() { + + $t->get_ok('/admin/users/upload.html')->status_is(200); + + my $users = new_domain_name(); + + $t->post_ok('/admin/users/upload.html' => form => { + type => 'openid' + ,create => 0 + ,users => { content => $users, filename => 'users.txt', 'Content-Type' => 'text/csv' }, + } + )->status_is(200); +} + ################################################################################ $ENV{MOJO_MODE} = 'development'; @@ -738,6 +752,7 @@ test_upload_no_admin($t); _login($t); +test_upload_html(); test_upload_json_fail(); test_upload_json();