Skip to content

Discount code quantity calculation logic is completely wrong #6879

@iamareebjamal

Description

@iamareebjamal

old_holders = get_count(
TicketHolder.query.filter(
TicketHolder.ticket_id.in_(ticket_ids) # pytype: disable=attribute-error
)
.join(Order)
.filter(Order.status.in_(['completed', 'placed']))
)

This just calculates all the bought tickets, and not the tickets bought with discount code. God knows how it was supposed to work.

Secondly, discount code should be redesigned as it is confusing, it is applicable to individual ticket instead of entire order, but is saved with the order instead. This needs to be discussed and decided later on as it is impossible to check which tickets the discount code was applied to in the order

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions