Skip to content

Commit

Permalink
Merge pull request #993 from OpenSignLabs/input_text_darkmode
Browse files Browse the repository at this point in the history
fix: display wrong owner's ip address on certificate in bulk-send flow
  • Loading branch information
prafull-opensignlabs authored Jul 31, 2024
2 parents aff409b + 779a84c commit 4a6b883
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/OpenSignServer/cloud/parsefunction/DocumentAftersave.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ async function DocumentAftersave(request) {
console.log('new entry is insert in contracts_Document');
const createdAt = request.object.get('createdAt');
const Folder = request.object.get('Type');
const ip = request?.headers?.['x-real-ip'] || request.object?.get('OriginIp') || '';
const ip = request?.headers?.['x-real-ip'] || '';
const originIp = request?.object?.get('OriginIp') || '';
if (createdAt && Folder === undefined) {
// console.log("IN If condition")
const TimeToCompleteDays = request.object.get('TimeToCompleteDays') || 15;
Expand All @@ -13,7 +14,9 @@ async function DocumentAftersave(request) {
const documentQuery = new Parse.Query('contracts_Document');
const updateQuery = await documentQuery.get(request.object.id, { useMasterKey: true });
updateQuery.set('ExpiryDate', ExpiryDate);
updateQuery.set('OriginIp', ip);
if (!originIp) {
updateQuery.set('OriginIp', ip);
}
const AutoReminder = request?.object?.get('AutomaticReminders') || false;
if (AutoReminder) {
const RemindOnceInEvery = request?.object?.get('RemindOnceInEvery') || 5;
Expand All @@ -29,7 +32,9 @@ async function DocumentAftersave(request) {
const documentQuery = new Parse.Query('contracts_Document');
const updateQuery = await documentQuery.get(request.object.id, { useMasterKey: true });
updateQuery.set('ExpiryDate', ExpiryDate);
updateQuery.set('OriginIp', ip);
if (!originIp) {
updateQuery.set('OriginIp', ip);
}
const AutoReminder = request?.object?.get('AutomaticReminders') || false;
if (AutoReminder) {
const RemindOnceInEvery = request?.object?.get('RemindOnceInEvery') || 5;
Expand Down

0 comments on commit 4a6b883

Please sign in to comment.