code stringlengths 41 2.04k | label_name stringclasses 2
values | label int64 0 1 |
|---|---|---|
$.each(postData, (index, value) => {
let input = $(document.createElement('input'));
input.attr('type', 'hidden');
input.attr('name', index);
input.val(value);
form.append(input);
}); | CWE-352 | 0 |
$scope.reset = function() {
bootbox.confirm('Are you sure you want to reset the foreign source definition to the default ?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteForeignSourceDefinition($scope.foreignSource).then(
functio... | CWE-352 | 0 |
wp.updates.updateError = function( response ) {
var $card = $( '.plugin-card-' + response.slug ),
$message,
$button,
name,
error_message;
wp.updates.updateDoneSuccessfully = false;
if ( response.errorCode && response.errorCode == 'unable_to_connect_to_filesystem' && wp.updates.shouldRequestFilesyst... | CWE-352 | 0 |
success: function (data) {
mydata = jQuery.parseJSON(data);
$.ajax({
type: 'GET',
url: '/manage/get_nodes_sw_versions',
data: {"nodes": nodes.join(",")},
timeout: pcs_timeout,
success: function(data) {
versions = jQuery.parseJSON(data);
update_... | CWE-384 | 1 |
$scope.refresh = function(requisition) {
RequisitionsService.startTiming();
RequisitionsService.updateDeployedStatsForRequisition(requisition).then(
function() { // success
growl.success('The deployed statistics for ' + requisition.foreignSource + ' has been updated.');
},
... | CWE-352 | 0 |
function create_resource(form, update, stonith) {
dataString = $(form).serialize();
var resourceID = $(form).find("[name='name']").val();
url = get_cluster_remote_url() + $(form).attr("action");
var name;
if (stonith)
name = "fence device";
else
name = "resource"
$.ajax({
type: "POST",
... | CWE-384 | 1 |
this.disableChatSoundAdmin = function(inst)
{
if (inst.prop('tagName') != 'I') {
inst = inst.find('> i.material-icons');
}
if (inst.text() == 'volume_off'){
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/1');
confLH.new_message_sound_admin_enabled = 1;
... | CWE-352 | 0 |
function create_group() {
var num_nodes = 0;
var node_names = "";
$("#resource_list :checked").parent().parent().each(function (index,element) {
if (element.getAttribute("nodeID")) {
num_nodes++;
node_names += element.getAttribute("nodeID") + " "
}
});
if (num_nodes == 0) {
alert("You... | CWE-384 | 1 |
data: {config_calibre_dir: $("#config_calibre_dir").val(), csrf_token: $("input[name='csrf_token']").val()},
success: function success(data) {
if ( data.change ) {
if ( data.valid ) {
confirmDialog(
"db_submit",
... | CWE-352 | 0 |
function genericAjaxPopupClose($layer, $event) {
$popup = genericAjaxPopupFetch($layer);
if(null != $popup) {
try {
if(null != $event)
$popup.trigger($event);
} catch(e) { if(window.console) console.log(e); }
try {
$popup.dialog('close');
} catch(e) { if(window.console) console.log(e); }
re... | CWE-352 | 0 |
$scope.save = function() {
var form = this.nodeForm;
RequisitionsService.startTiming();
RequisitionsService.saveNode($scope.node).then(
function() { // success
growl.success('The node ' + $scope.node.nodeLabel + ' has been saved.');
$scope.foreignId = $scope.node.foreig... | CWE-352 | 0 |
message: app.vtranslate('JS_LBL_ARE_YOU_SURE_YOU_WANT_TO_DELETE_FILTER')
}).done((e) => {
app.openUrlMethodPost(thisInstance.getSelectOptionFromChosenOption(liElement).data('deleteurl'));
});
event.stopPropagation();
}); | CWE-352 | 0 |
$scope.addRequisition = function() {
bootbox.prompt('A requisition is required, please enter the name for a new requisition', function(foreignSource) {
if (foreignSource) {
RequisitionsService.addRequisition(foreignSource).then(
function() { // success
RequisitionsS... | CWE-352 | 0 |
$scope.delete = function(foreignSource) {
bootbox.confirm('Are you sure you want to remove the requisition ' + foreignSource + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteRequisition(foreignSource).then(
function() { // suc... | CWE-352 | 0 |
"Create Group": function() {
var data = $('#add_group > form').serialize();
var url = get_cluster_remote_url() + "add_group";
$.ajax({
type: "POST",
url: url,
data: data,
success: function() {
Pcs.update();
$("#add_group").dia... | CWE-384 | 1 |
wp.updates.decrementCount = function( upgradeType ) {
var count,
pluginCount,
$adminBarUpdateCount = $( '#wp-admin-bar-updates .ab-label' ),
$dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ),
$pluginsMenuItem = $( '#menu-plugins' );
count = $adminBarUpdateCount.text();
... | CWE-352 | 0 |
rcube_webmail.prototype.managesieve_setget = function()
{
var id = this.filtersets_list.get_single_selection(),
script = this.env.filtersets[id];
location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_act=setget&_set='+urlencode(script);
}; | CWE-352 | 0 |
$scope.refresh = function(requisition) {
RequisitionsService.startTiming();
RequisitionsService.updateDeployedStatsForRequisition(requisition).then(
function() { // success
growl.success('The deployed statistics for ' + requisition.foreignSource + ' has been updated.');
},
... | CWE-352 | 0 |
this.disableChatSoundUser = function(inst)
{
if (inst.find('> i').text() == 'volume_off') {
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/1');
confLH.new_message_sound_user_enabled = 1;
inst.find('> i').text('volume_up');
} else {
$.get(this.wwwDir+ 'user/setsettingaja... | CWE-352 | 0 |
this.disableNewChatSoundAdmin = function(inst)
{
if (inst.prop('tagName') != 'I') {
inst = inst.find('> i.material-icons');
}
if (inst.text() == 'volume_off'){
$.get(this.wwwDir+ 'user/setsettingajax/new_chat_sound/1');
confLH.new_chat_sound_enabled = 1;
inst... | CWE-352 | 0 |
registerApproveFilterClickEvent: function () {
const thisInstance = this;
const listViewFilterBlock = this.getFilterBlock();
if (listViewFilterBlock != false) {
listViewFilterBlock.on('mouseup', '.js-filter-approve', (event) => {
//to close the dropdown
thisInstance.getFilterSelectElement().dat... | CWE-352 | 0 |
$scope.removeAllNodes = function(foreignSource) {
bootbox.confirm('Are you sure you want to remove all the nodes from ' + foreignSource + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.removeAllNodesFromRequisition(foreignSource).then(
... | CWE-352 | 0 |
function node_link_action(link_selector, url, label) {
var node = $.trim($("#node_info_header_title_name").text());
fade_in_out(link_selector);
$.ajax({
type: 'POST',
url: url,
data: {"name": node},
success: function() {
},
error: function (xhr, status, error) {
alert(
"Unabl... | CWE-384 | 1 |
$scope.provision = function() {
$scope.isSaving = true;
growl.info($sanitize('The node ' + $scope.node.nodeLabel + ' is being added to requisition ' + $scope.node.foreignSource + '. Please wait...'));
var successMessage = $sanitize('The node ' + $scope.node.nodeLabel + ' has been added to requisit... | CWE-352 | 0 |
$scope.clone = function(foreignSource) {
var availableForeignSources = [];
angular.forEach($scope.requisitionsData.requisitions, function(r) {
if (r.foreignSource !== foreignSource) {
availableForeignSources.push(r.foreignSource);
}
});
var modalInstance = $uibModal... | CWE-352 | 0 |
wp.updates.queueChecker = function() {
if ( wp.updates.updateLock || wp.updates.updateQueue.length <= 0 ) {
return;
}
var job = wp.updates.updateQueue.shift();
wp.updates.updatePlugin( job.data.plugin, job.data.slug );
}; | CWE-352 | 0 |
wp.updates.keydown = function( event ) {
if ( 27 === event.keyCode ) {
wp.updates.requestForCredentialsModalCancel();
} else if ( 9 === event.keyCode ) {
// #upgrade button must always be the last focusable element in the dialog.
if ( event.target.id === 'upgrade' && ! event.shiftKey ) {
$( '#hostname... | CWE-352 | 0 |
this.switch_task = function(task)
{
if (this.task === task && task != 'mail')
return;
var url = this.get_task_url(task);
if (task == 'mail')
url += '&_mbox=INBOX';
else if (task == 'logout' && !this.env.server_error) {
url += '&_token=' + this.env.request_token;
this.clear_... | CWE-352 | 0 |
$scope.deleteNode = function(node) {
bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteNode(node).then(
function() { // success
var inde... | CWE-352 | 0 |
$scope.initialize = function() {
growl.success('Retrieving definition for requisition ' + $scope.foreignSource + '...');
RequisitionsService.getForeignSourceDefinition($scope.foreignSource).then(
function(foreignSourceDef) { // success
$scope.foreignSourceDef = foreignSourceDef;
... | CWE-352 | 0 |
$scope.delete = function(foreignSource) {
bootbox.confirm('Are you sure you want to remove the requisition ' + foreignSource + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteRequisition(foreignSource).then(
function() { // suc... | CWE-352 | 0 |
static void print_buttons(HttpRequest req, HttpResponse res, Service_T s) {
if (is_readonly(req)) {
// A read-only REMOTE_USER does not get access to these buttons
return;
}
StringBuffer_append(res->outputbuffer, "<table id='buttons'><tr>");
/* Start prog... | CWE-352 | 0 |
static void handle_run(HttpRequest req, HttpResponse res) {
const char *action = get_parameter(req, "action");
if (action) {
if (is_readonly(req)) {
send_error(req, res, SC_FORBIDDEN, "You do not have sufficient privileges to access this page");
... | CWE-352 | 0 |
void set_header(HttpResponse res, const char *name, const char *value) {
HttpHeader h = NULL;
ASSERT(res);
ASSERT(name);
NEW(h);
h->name = Str_dup(name);
h->value = Str_dup(value);
if (res->headers) {
HttpHeader n, p;
for (n = p =... | CWE-352 | 0 |
static void doGet(HttpRequest req, HttpResponse res) {
set_content_type(res, "text/html");
if (ACTION(HOME)) {
LOCK(Run.mutex)
do_home(res);
END_LOCK;
} else if (ACTION(RUN)) {
handle_run(req, res);
} else if (ACTION(TEST)) ... | CWE-352 | 0 |
void set_content_type(HttpResponse res, const char *mime) {
set_header(res, "Content-Type", mime);
} | CWE-352 | 0 |
static void handle_action(HttpRequest req, HttpResponse res) {
char *name = req->url;
Service_T s = Util_getService(++name);
if (! s) {
send_error(req, res, SC_NOT_FOUND, "There is no service named \"%s\"", name ? name : "");
return;
}
const char *... | CWE-352 | 0 |
def test_invoice_payment_is_still_pending_for_registration_codes(self):
"""
test generate enrollment report
enroll a user in a course using registration code
whose invoice has not been paid yet
"""
course_registration_code = CourseRegistrationCode.objects.create(
... | CWE-352 | 0 |
def test_modify_access_allow_with_uname(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_instructor.username,
'rolename': 'staff',
'action':... | CWE-352 | 0 |
def test_get_student_progress_url_nostudent(self):
""" Test that the endpoint 400's when requesting an unknown email. """
url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.s... | CWE-352 | 0 |
def test_post_only(self):
"""
Verify that we can't call the view when we aren't using POST.
"""
self.client.login(username=self.staff_user.username, password='test')
response = self.call_add_users_to_cohorts('', method='GET')
self.assertEqual(response.status_code, 405... | CWE-352 | 0 |
def test_list_entrance_exam_instructor_tasks_all_student(self):
""" Test list task history for entrance exam AND all student. """
url = reverse('list_entrance_exam_instructor_tasks', kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url, {})
self.assertEqual(r... | CWE-352 | 0 |
def list_course_role_members(request, course_id):
"""
List instructors and staff.
Requires instructor access.
rolename is one of ['instructor', 'staff', 'beta', 'ccx_coach']
Returns JSON of the form {
"course_id": "some/course/id",
"staff": [
{
"username... | CWE-352 | 0 |
def test_get_delete_dataobj(test_app, client: FlaskClient, note_fixture):
response = client.get("/dataobj/delete/1")
assert response.status_code == 302 | CWE-352 | 0 |
def test_list_entrance_exam_instructor_with_invalid_exam_key(self):
""" Test list task history for entrance exam failure if course has invalid exam. """
url = reverse('list_entrance_exam_instructor_tasks',
kwargs={'course_id': unicode(self.course_with_invalid_ee.id)})
r... | CWE-352 | 0 |
def test_course_has_entrance_exam_in_student_attempts_reset(self):
""" Test course has entrance exam id set while resetting attempts"""
url = reverse('reset_student_attempts_for_entrance_exam',
kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(ur... | CWE-352 | 0 |
def test_show_student_extensions(self):
self.test_change_due_date()
url = reverse('show_student_extensions',
kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {'student': self.user1.username})
self.assertEqual(response.... | CWE-352 | 0 |
def test_list_course_role_members_staff(self):
url = reverse('list_course_role_members', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'rolename': 'staff',
})
self.assertEqual(response.status_code, 200)
# check res... | CWE-352 | 0 |
def test_reset_student_attempts_single(self):
""" Test reset single student attempts. """
url = reverse('reset_student_attempts', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'... | CWE-352 | 0 |
def test_reset_nonexistent_extension(self):
url = reverse('reset_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
})
sel... | CWE-352 | 0 |
def test_reset_date(self):
self.test_change_due_date()
url = reverse('reset_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
... | CWE-352 | 0 |
def test_list_course_role_members_noparams(self):
""" Test missing all query parameters. """
url = reverse('list_course_role_members', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.status_code, 400) | CWE-352 | 0 |
def test_get_ora2_responses_success(self):
url = reverse('export_ora2_data', kwargs={'course_id': unicode(self.course.id)})
with patch('instructor_task.api.submit_export_ora2_data') as mock_submit_ora2_task:
mock_submit_ora2_task.return_value = True
response = self.client.ge... | CWE-352 | 0 |
def test_reset_extension_to_deleted_date(self):
"""
Test that we can delete a due date extension after deleting the normal
due date, without causing an error.
"""
url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response =... | CWE-352 | 0 |
def test_modify_access_with_inactive_user(self):
self.other_user.is_active = False
self.other_user.save() # pylint: disable=no-member
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_stu... | CWE-352 | 0 |
def test_certificates_features_against_status(self):
"""
Test certificates with status 'downloadable' should be in the response.
"""
url = reverse('get_issued_certificates', kwargs={'course_id': unicode(self.course.id)})
# firstly generating downloadable certificates with 'ho... | CWE-352 | 0 |
def test_calculate_report_csv_success(self, report_type, instructor_api_endpoint, task_api_endpoint, extra_instructor_api_kwargs):
kwargs = {'course_id': unicode(self.course.id)}
kwargs.update(extra_instructor_api_kwargs)
url = reverse(instructor_api_endpoint, kwargs=kwargs)
success_... | CWE-352 | 0 |
def test_list_entrance_exam_instructor_tasks_student(self):
""" Test list task history for entrance exam AND student. """
# create a re-score entrance exam task
url = reverse('rescore_entrance_exam', kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url, {
... | CWE-352 | 0 |
def qute_settings(url):
"""Handler for qute://settings. View/change qute configuration."""
if url.path() == '/set':
return _qute_settings_set(url)
src = jinja.render('settings.html', title='settings',
configdata=configdata,
confget=config.instance.get_s... | CWE-352 | 0 |
def test_change_to_invalid_due_date(self):
url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
'due_datet... | CWE-352 | 0 |
def assert_update_forum_role_membership(self, current_user, identifier, rolename, action):
"""
Test update forum role membership.
Get unique_student_identifier, rolename and action and update forum role.
"""
url = reverse('update_forum_role_membership', kwargs={'course_id': s... | CWE-352 | 0 |
def test_modify_access_with_fake_user(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': 'GandalfTheGrey',
'rolename': 'staff',
'action': 'revoke',
... | CWE-352 | 0 |
def require_post_params(*args, **kwargs):
"""
Checks for required parameters or renders a 400 error.
(decorator with arguments)
Functions like 'require_query_params', but checks for
POST parameters rather than GET parameters.
"""
required_params = []
required_params += [(arg, None) for ... | CWE-352 | 0 |
def test_get_anon_ids(self):
"""
Test the CSV output for the anonymized user ids.
"""
url = reverse('get_anon_ids', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
self.assertEqual(response['Content-Type'], 'text/csv')
... | CWE-352 | 0 |
def test_rescore_problem_all(self, act):
""" Test rescoring for all students. """
url = reverse('rescore_problem', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'all_students': ... | CWE-352 | 0 |
def test_get_students_features_cohorted(self, is_cohorted):
"""
Test that get_students_features includes cohort info when the course is
cohorted, and does not when the course is not cohorted.
"""
url = reverse('get_students_features', kwargs={'course_id': unicode(self.course.... | CWE-352 | 0 |
def test_modify_access_revoke_not_allowed(self):
""" Test revoking access that a user does not have. """
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_staff.ema... | CWE-352 | 0 |
def test_rescore_entrance_exam_single_student(self, act):
""" Test re-scoring of entrance exam for single student. """
url = reverse('rescore_entrance_exam', kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url, {
'unique_student_identifier': self.student... | CWE-352 | 0 |
def test_get_ora2_responses_already_running(self):
url = reverse('export_ora2_data', kwargs={'course_id': unicode(self.course.id)})
with patch('instructor_task.api.submit_export_ora2_data') as mock_submit_ora2_task:
mock_submit_ora2_task.side_effect = AlreadyRunningError()
r... | CWE-352 | 0 |
def test_modify_access_revoke_self(self):
"""
Test that an instructor cannot remove instructor privelages from themself.
"""
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_stude... | CWE-352 | 0 |
def test_list_report_downloads(self):
url = reverse('list_report_downloads', kwargs={'course_id': self.course.id.to_deprecated_string()})
with patch('instructor_task.models.LocalFSReportStore.links_for') as mock_links_for:
mock_links_for.return_value = [
('mock_file_name_... | CWE-352 | 0 |
def test_entrance_exam_sttudent_delete_state(self):
""" Test delete single student entrance exam state. """
url = reverse('reset_student_attempts_for_entrance_exam',
kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url, {
'unique_stu... | CWE-352 | 0 |
def test_get_delete_dataobj_not_found(test_app, client: FlaskClient):
response = client.get("/dataobj/delete/1")
assert response.status_code == 302 | CWE-352 | 0 |
def test_dir(self, tmpdir):
url = QUrl.fromLocalFile(str(tmpdir))
req = QNetworkRequest(url)
reply = filescheme.handler(req)
# The URL will always use /, even on Windows - so we force this here
# too.
tmpdir_path = str(tmpdir).replace(os.sep, '/')
assert reply... | CWE-352 | 0 |
def test_modify_access_noparams(self):
""" Test missing all query parameters. """
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.status_code, 400) | CWE-352 | 0 |
def test_certificates_features_csv(self):
"""
Test for certificate csv features.
"""
url = reverse('get_issued_certificates', kwargs={'course_id': unicode(self.course.id)})
url += '?csv=true'
# firstly generating downloadable certificates with 'honor' mode
cer... | CWE-352 | 0 |
def test_get_sale_records_features_json(self):
"""
Test that the response from get_sale_records is in json format.
"""
for i in range(5):
course_registration_code = CourseRegistrationCode(
code='sale_invoice{}'.format(i),
course_id=self.cou... | CWE-352 | 0 |
def wrapped(*args, **kwargs): # pylint: disable=missing-docstring
request = args[0]
error_response_data = {
'error': 'Missing required query parameter(s)',
'parameters': [],
'info': {},
}
for (param, extra) in req... | CWE-352 | 0 |
def shutdown():
task = int(request.args.get("parameter").strip())
showtext = {}
if task in (0, 1): # valid commandos received
# close all database connections
calibre_db.dispose()
ub.dispose()
if task == 0:
showtext['text'] = _(u'Server restarted, please reload ... | CWE-352 | 0 |
def test_qute_settings_persistence(short_tmpdir, request, quteproc_new):
"""Make sure settings from qute://settings are persistent."""
args = _base_args(request.config) + ['--basedir', str(short_tmpdir)]
quteproc_new.start(args)
quteproc_new.open_path(
'qute://settings/set?option=search.ignore_c... | CWE-352 | 0 |
def test_list_instructor_tasks_running(self, act):
""" Test list of all running tasks. """
act.return_value = self.tasks
url = reverse('list_instructor_tasks', kwargs={'course_id': self.course.id.to_deprecated_string()})
mock_factory = MockCompletionInfo()
with patch('instruc... | CWE-352 | 0 |
def test_list_course_role_members_beta(self):
url = reverse('list_course_role_members', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'rolename': 'beta',
})
self.assertEqual(response.status_code, 200)
# check respo... | CWE-352 | 0 |
def reset_due_date(request, course_id):
"""
Rescinds a due date extension for a student on a particular unit.
"""
course = get_course_by_id(SlashSeparatedCourseKey.from_deprecated_string(course_id))
student = require_student_from_identifier(request.GET.get('student'))
unit = find_unit(course, re... | CWE-352 | 0 |
def test_reset_entrance_exam_student_attempts_single(self):
""" Test reset single student attempts for entrance exam. """
url = reverse('reset_student_attempts_for_entrance_exam',
kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url, {
... | CWE-352 | 0 |
def test_show_unit_extensions(self):
self.test_change_due_date()
url = reverse('show_unit_extensions',
kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {'url': self.week1.location.to_deprecated_string()})
self.assertEq... | CWE-352 | 0 |
def test_rescore_entrance_exam_all_student_and_single(self):
""" Test re-scoring with both all students and single student parameters. """
url = reverse('rescore_entrance_exam', kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url, {
'unique_student_ident... | CWE-352 | 0 |
def add_security_headers(resp):
resp.headers['Content-Security-Policy'] = "default-src 'self' 'unsafe-inline' 'unsafe-eval';"
if request.endpoint == "editbook.edit_book":
resp.headers['Content-Security-Policy'] += "img-src * data:"
resp.headers['X-Content-Type-Options'] = 'nosniff'
resp.headers[... | CWE-352 | 0 |
def test_change_nonexistent_due_date(self):
url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week3.location.to_deprecated_string(),
'due_date... | CWE-352 | 0 |
def test_change_due_date(self):
url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
'due_datetime': '12/3... | CWE-352 | 0 |
def test_list_instructor_tasks_problem(self, act):
""" Test list task history for problem. """
act.return_value = self.tasks
url = reverse('list_instructor_tasks', kwargs={'course_id': self.course.id.to_deprecated_string()})
mock_factory = MockCompletionInfo()
with patch('ins... | CWE-352 | 0 |
def get_student_progress_url(request, course_id):
"""
Get the progress url of a student.
Limited to staff access.
Takes query paremeter unique_student_identifier and if the student exists
returns e.g. {
'progress_url': '/../...'
}
"""
course_id = SlashSeparatedCourseKey.from_dep... | CWE-352 | 0 |
def test_reset_entrance_exam_all_student_attempts(self, act):
""" Test reset all student attempts for entrance exam. """
url = reverse('reset_student_attempts_for_entrance_exam',
kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url, {
... | CWE-352 | 0 |
def list_entrance_exam_instructor_tasks(request, course_id): # pylint: disable=invalid-name
"""
List entrance exam related instructor tasks.
Takes either of the following query parameters
- unique_student_identifier is an email or username
- all_students is a boolean
"""
course_id ... | CWE-352 | 0 |
def test_entrance_exam_delete_state_with_staff(self):
""" Test entrance exam delete state failure with staff access. """
self.client.logout()
staff_user = StaffFactory(course_key=self.course.id)
self.client.login(username=staff_user.username, password='test')
url = reverse('r... | CWE-352 | 0 |
def test_reset_entrance_exam_student_attempts_deletall(self):
""" Make sure no one can delete all students state on entrance exam. """
url = reverse('reset_student_attempts_for_entrance_exam',
kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(url... | CWE-352 | 0 |
def test_modify_access_revoke_with_username(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_staff.username,
'rolename': 'staff',
'action': ... | CWE-352 | 0 |
def test_get_student_progress_url_noparams(self):
""" Test that the endpoint 404's without the required query params. """
url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.s... | CWE-352 | 0 |
def test_entrance_exam_reset_student_attempts_nonsense(self):
""" Test failure with both unique_student_identifier and all_students. """
url = reverse('reset_student_attempts_for_entrance_exam',
kwargs={'course_id': unicode(self.course.id)})
response = self.client.get(u... | CWE-352 | 0 |
def test_get_students_features_teams(self, has_teams):
"""
Test that get_students_features includes team info when the course is
has teams enabled, and does not when the course does not have teams enabled
"""
if has_teams:
self.course = CourseFactory.create(teams_... | CWE-352 | 0 |
def test_get_student_progress_url_from_uname(self):
""" Test that progress_url is in the successful response. """
url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})
url += "?unique_student_identifier={}".format(
quote(self.stude... | CWE-352 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.