Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error when creating profiles that are in draft by default #44

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.1
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
Loading