old_contents: // Copyright (c) 2019, Frappe Technologies and contributors
  // For license information, please see license.txt
  
  frappe.ui.form.on('Personal Data Download Request', {
  	onload: function(frm){
  		frm.doc.user = frappe.session.user;
  	},
  });
  
new_contents: // Copyright (c) 2019, Frappe Technologies and contributors
  // For license information, please see license.txt
  
  frappe.ui.form.on('Personal Data Download Request', {
  	onload: function(frm) {
  		if (frm.is_new()) {
  			frm.doc.user = frappe.session.user;
  		}
  	},
  });
  
subject: Set session user only for new document (#7837)