Skip to content

Commit

Permalink
Correct calculation of membership expiration for enrollment request o…
Browse files Browse the repository at this point in the history
…f an already member
  • Loading branch information
cgeorgilakis-grnet committed Sep 24, 2024
1 parent b6b941b commit 745d9af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve add/remove admin emails
- Added Valid From to Invitation Flow

### Fixed
- Correct calculation of membership expiration for enrollment request of an already member

## [0.21.1]

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,11 @@ public void createOrUpdate(GroupEnrollmentRequestEntity enrollmentEntity, Keyclo
if (isNotMember) {
entity.setValidFrom(configuration.getValidFrom() == null || !configuration.getValidFrom().isAfter(LocalDate.now()) ? LocalDate.now() : configuration.getValidFrom());
}
if (configuration.getMembershipExpirationDays() != null) {
if (configuration.getMembershipExpirationDays() != null && entity.getValidFrom().isAfter(LocalDate.now())) {
entity.setMembershipExpiresAt(entity.getValidFrom().plusDays(configuration.getMembershipExpirationDays()));
} else {
} else if (configuration.getMembershipExpirationDays() != null) {
entity.setMembershipExpiresAt(LocalDate.now().plusDays(configuration.getMembershipExpirationDays()));
}else {
entity.setMembershipExpiresAt(null);
}
entity.setGroup(configuration.getGroup());
Expand Down

0 comments on commit 745d9af

Please sign in to comment.