Skip to content
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
7 changes: 5 additions & 2 deletions amelie/activities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,15 @@ def form_valid(self, form):
# Check if the enrollment was indirect and the option to skip the waiting list for this enrollment was selected.
force_skip_waiting_list = self.indirect and form.cleaned_data.get('indirect', {}).get('waiting_list', None) == "skip"

# Save if the activity is full or not, for the check whether to create transactions or not later on
activity_is_full = self.activity.enrollment_full

# Enroll the person
participation = Participation(
person=self.person,
event=self.activity,
added_by=self.request.person,
waiting_list=(self.activity.enrollment_full and not force_skip_waiting_list)
waiting_list=(activity_is_full and not force_skip_waiting_list)
)

if self.indirect:
Expand Down Expand Up @@ -570,7 +573,7 @@ def form_valid(self, form):
participation.delete()
return render(self.request, "activity_enrollment_mandate.html", {'activity': self.activity})

if price and (force_skip_waiting_list or not self.activity.enrollment_full):
if price and (force_skip_waiting_list or not activity_is_full):
transactions.add_participation(participation=participation, added_by=self.request.person)

# Maybe send a notification e-mail to the person and set a status message in the request.
Expand Down
2 changes: 1 addition & 1 deletion amelie/personal_tab/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def clean(self):
_l('The amount must be a positive number.')
)

elif description.strip() == '':
elif not description or description.strip() == '':
raise forms.ValidationError(
_l('Please provide a description for your declaration.')
)
Expand Down
2 changes: 1 addition & 1 deletion amelie/personal_tab/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def generate_overview(request, person, date_from=None, date_to=None):
overview_type = None
total = False
totals = None
all_payment_totals = None
all_payment_totals = []
kcal_totals = None
all_transactions = None
payment_transactions = None
Expand Down
Loading