Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAK-50903 Creating a new assignment and putting it to site users crea…
Browse files Browse the repository at this point in the history
…tes an asn.new.assignment event, but this does not happen when putting it to selected groups.
susowrc committed Jan 28, 2025
1 parent fb1e314 commit ce681b1
Showing 1 changed file with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -9100,24 +9100,13 @@ private void post_save_assignment(RunData data, String postOrSave) {
}

if ((newAssignment && !a.getDraft()) || (!a.getDraft() && !newAssignment)) {

Collection aGroups = a.getGroups();
if (aGroups.size() != 0) {
// If already open
if (openTime.isBefore(Instant.now())) {
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_ADD_ASSIGNMENT, assignmentReference, true));
} else {
// Not open yet, delay the event
eventTrackingService.delay(eventTrackingService.newEvent(AssignmentConstants.EVENT_AVAILABLE_ASSIGNMENT, assignmentReference,
true), openTime);
}
// If already open
if (openTime.isBefore(Instant.now())) {
// post new assignment event since it is fully initialized by now
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_ADD_ASSIGNMENT, assignmentReference, true));
} else {
if (openTime.isBefore(Instant.now())) {
// post new assignment event since it is fully initialized by now
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_ADD_ASSIGNMENT, assignmentReference, true));
} else {
eventTrackingService.delay(eventTrackingService.newEvent(AssignmentConstants.EVENT_AVAILABLE_ASSIGNMENT, assignmentReference, true), openTime);
}
// Not open yet, delay the event
eventTrackingService.delay(eventTrackingService.newEvent(AssignmentConstants.EVENT_AVAILABLE_ASSIGNMENT, assignmentReference, true), openTime);
}
}
}

0 comments on commit ce681b1

Please sign in to comment.