Skip to content

Commit

Permalink
Change to update only attributes that are present
Browse files Browse the repository at this point in the history
  • Loading branch information
milosdes committed Dec 18, 2024
1 parent 80e8aff commit 23d0926
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions api/reviewer_api/services/documentservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,9 @@ def updatedocumentpersonalattributes(self, payload, userid):
if payload["personalattributes"] is not None:
#apply change to all
if(len(payload["documentmasterids"]) > 1):
if(payload["personalattributes"]["person"] is not None):
newdocattributes["personalattributes"]["person"]=payload["personalattributes"]["person"]
if(payload["personalattributes"]["filetype"] is not None):
newdocattributes["personalattributes"]["filetype"]=payload["personalattributes"]["filetype"]
for attribute in payload["personalattributes"]:
if(payload["personalattributes"][attribute] is not None and len(payload["personalattributes"][attribute]) > 0):
newdocattributes["personalattributes"][attribute]=payload["personalattributes"][attribute]
#apply change to individual
else:
newdocattributes["personalattributes"] = payload["personalattributes"]
Expand Down

0 comments on commit 23d0926

Please sign in to comment.