Skip to content

Commit

Permalink
Fix no esconder transferencias despues de compartir todos los bonos
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermodoghel committed Jan 19, 2025
1 parent 3b6cdf4 commit 96895c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion user_profile/templates/mi_fuego/my_tickets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

</li>
{% endif %}
{% if holding_tickets > 0 %}
{% if holding_tickets|add:shared_tickets > 0 %}
<li class="nav-item">
<a class="nav-link{% if nav_secondary == "transferable_tickets" %} active{% endif %}"
href="{% url 'transferable_tickets' %}">Bonos para transferir ({{ holding_tickets }}) </a>
Expand Down
7 changes: 6 additions & 1 deletion utils/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from deprepagos import settings
from events.models import Event
from tickets.models import NewTicket, TicketType
from tickets.models import NewTicket, TicketType, NewTicketTransfer


def current_event(request):
Expand Down Expand Up @@ -36,12 +36,17 @@ def current_event(request):
has_transfer_pending = any(
ticket["is_transfer_pending"] is True for ticket in tickets_dto
)

shared_tickets = NewTicketTransfer.objects.filter(
tx_from=request.user, status="COMPLETED").count()

context.update(
{
"has_unassigned_tickets": has_unassigned_tickets,
"has_transfer_pending": has_transfer_pending,
"has_available_tickets": TicketType.objects.get_available_ticket_types_for_current_events().exists(),
"holding_tickets": len(tickets),
"shared_tickets": shared_tickets,
"owns_ticket": owns_ticket,
}
)
Expand Down

0 comments on commit 96895c2

Please sign in to comment.