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

SAK-50903 Assignments a new assignment using groups should emit an asn.new.assignment event #13234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -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_UPDATE_ASSIGNMENT_ACCESS, 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);
}
}
}
Expand Down
Loading