Skip to content

Commit

Permalink
Added userId check to toggleDraftMode method
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-brinkman committed Dec 15, 2023
1 parent fbe7951 commit 178b8d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
profileServiceVersion=5.2-SNAPSHOT
profileServiceVersion=5.2.2-SNAPSHOT
grailsVersion=5.2.4
gorm.version=7.3.2
groovyVersion=3.0.11
Expand Down
7 changes: 6 additions & 1 deletion grails-app/services/au/org/ala/profile/ProfileService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,12 @@ class ProfileService extends BaseDataAccessService {
save profile
} else {
profile.draft = profile.draft ?: CloneAndDraftUtil.createDraft(profile)
profile.draft.createdBy = userService.getUserForUserId(userService.getUserId()).displayName

if (userService.getUserId()) {
profile.draft.createdBy = userService.getUserForUserId(userService.getUserId()).displayName
} else {
log.debug("No user ID when switching profile to draft")
}

save profile
}
Expand Down

0 comments on commit 178b8d6

Please sign in to comment.