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

Fix bug where enrollments with attendance could be canceled and break… #17597

Merged
merged 2 commits into from
Sep 22, 2017

Conversation

aoby
Copy link
Contributor

@aoby aoby commented Sep 7, 2017

… payment reports

Error in the wild
Task

This fix is in 2 parts:

  1. Include deleted enrollments in the payment calculator (+ unit test). This will fix the issue where it breaks payment reports. Note: without the new with_deleted addition, the new test case fails in the same was as the above error.

  2. Block canceling enrollments that have attendance in the first place.

@@ -89,6 +89,8 @@ def cancel
@enrollment = Pd::Enrollment.find_by_code params[:code]
if @enrollment.nil?
render_404
elsif !@enrollment.attendances.empty?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer any? instead of negating empty

@@ -0,0 +1,5 @@
%p
You have already attended this workshop.
%p
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nested <p> tags intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. Will remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from here. I'll fix that one too

@aoby aoby merged commit 4fbaf29 into staging Sep 22, 2017
@aoby aoby deleted the fix-pd-cancel-enrollment-with-attendance-bug branch September 22, 2017 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants