Merged in feature/VBV-690-no-kn (pull request #340)
Fix MultipleObjectsReturned exception
This commit is contained in:
commit
4837f61a2d
|
|
@ -55,7 +55,9 @@ class CompetenceCertificateQuery(object):
|
|||
root, info, id=None, slug=None, course_id=None, course_slug=None, user_id=None
|
||||
):
|
||||
try:
|
||||
course_session_user = CourseSessionUser.objects.get(user__id=user_id)
|
||||
course_session_user = CourseSessionUser.objects.filter(
|
||||
user__id=user_id
|
||||
).first()
|
||||
except CourseSessionUser.DoesNotExist:
|
||||
return None
|
||||
|
||||
|
|
|
|||
|
|
@ -75,9 +75,11 @@ def create_customer_xml(checkout_information: CheckoutInformation):
|
|||
abacus_debitor_number=customer.abacus_debitor_number,
|
||||
last_name=checkout_information.last_name,
|
||||
first_name=checkout_information.first_name,
|
||||
company_name=checkout_information.organisation_detail_name
|
||||
if checkout_information.invoice_address == "org"
|
||||
else "",
|
||||
company_name=(
|
||||
checkout_information.organisation_detail_name
|
||||
if checkout_information.invoice_address == "org"
|
||||
else ""
|
||||
),
|
||||
street=(
|
||||
checkout_information.organisation_street
|
||||
if checkout_information.invoice_address == "org"
|
||||
|
|
|
|||
Loading…
Reference in New Issue