hide gamechanger if no gamechanger account exists
This commit is contained in:
@@ -34,16 +34,18 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<button type="Submit" class="btn btn-teamsnap btn-sm py-0 m-1" formaction="{% url 'teamsnap_submit_lineup' team_id=event.data.team_id event_id=event.data.id %}" form="form-lineup-{{ event.data.id }}" id="submit-lineup-gamechanger-{{ event.data.id }}">
|
||||
<button type="Submit" class="btn btn-teamsnap btn-sm py-0 m-1" formaction="{% url 'teamsnap_submit_lineup' team_id=event.data.team_id event_id=event.data.id %}" form="form-lineup-{{ event.data.id }}" id="submit-lineup-teamsnap-{{ event.data.id }}">
|
||||
<i class="bi bi-arrow-right"></i>
|
||||
TeamSnap
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
{% if request.user.gamechanger_account %}
|
||||
<button type="Submit" class="btn btn-gamechanger btn-sm py-0 m-1 text-nowrap" formaction="{% url 'gamechanger_lineup_submit' %}" form="form-lineup-{{ event.data.id }}" id="submit-lineup-gamechanger-{{ event.data.id }}">
|
||||
<i class="bi bi-arrow-right"></i>
|
||||
GameChanger
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -234,7 +234,12 @@ def submit_lineup(request, team_id, event_id):
|
||||
return HttpResponseServerError
|
||||
|
||||
|
||||
def multi_lineup_choose(request, team_id):
|
||||
def multi_lineup_choose(request, team_id=None):
|
||||
if not team_id:
|
||||
return redirect(
|
||||
"teamsnap_choose_multiple_lineups",
|
||||
team_id=request.user.teamsnap_preferences.managed_team_id,
|
||||
)
|
||||
from django.forms import formset_factory
|
||||
from pyteamsnap.api import Event
|
||||
|
||||
|
||||
Reference in New Issue
Block a user