Skip to content

Commit

Permalink
[#1746] Add content_owner for new organisations
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Oct 2, 2015
1 parent 028c5e5 commit a0ea4e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions akvo/rsr/static/scripts-src/myrsr-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,6 @@ function setModalOnClicks() {
}

/* Show the "add organisation" modal dialog */

function addOrgModal() {

/* Remove the modal */
Expand All @@ -2139,13 +2138,16 @@ function addOrgModal() {
/* Submit the new org */
function submitModal() {
if (allInputsFilled()) {
var api_url, request, form, form_data;
var api_url, request, form, form_data, reporting_org_id;
// Add organisation to DB
form = document.querySelector('#addOrganisation');

form_data = serialize(form);
form_data = form_data.replace('iati_org_id=&', '');

reporting_org_id = document.querySelector('#reportingOrganisation').getAttributeNode("value").value;
form_data += '&content_owner=' + reporting_org_id;

api_url = '/rest/v1/organisation/?format=json';

request = new XMLHttpRequest();
Expand Down
6 changes: 4 additions & 2 deletions akvo/rsr/static/scripts-src/myrsr-admin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,6 @@ function setModalOnClicks() {
}

/* Show the "add organisation" modal dialog */

function addOrgModal() {

/* Remove the modal */
Expand All @@ -2139,13 +2138,16 @@ function addOrgModal() {
/* Submit the new org */
function submitModal() {
if (allInputsFilled()) {
var api_url, request, form, form_data;
var api_url, request, form, form_data, reporting_org_id;
// Add organisation to DB
form = document.querySelector('#addOrganisation');

form_data = serialize(form);
form_data = form_data.replace('iati_org_id=&', '');

reporting_org_id = document.querySelector('#reportingOrganisation').getAttributeNode("value").value;
form_data += '&content_owner=' + reporting_org_id;

api_url = '/rest/v1/organisation/?format=json';

request = new XMLHttpRequest();
Expand Down

0 comments on commit a0ea4e1

Please sign in to comment.