Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confusion with both senses of primary leagues #419

Open
angelsesma opened this issue Jan 7, 2021 · 2 comments
Open

confusion with both senses of primary leagues #419

angelsesma opened this issue Jan 7, 2021 · 2 comments

Comments

@angelsesma
Copy link
Contributor

/ladder subdirectory to be included in the href string

@climu
Copy link
Owner

climu commented Jan 7, 2021

Thanks for spotting that. Actually the issue is more of an undocumented and unused feature:

One league is called primary. There is a button in league admin tools to set it:
image

The url /league/ will always direct to the primary league.

So the issue here is the primary league have not been updated for ages.

Mind that the name is quite confusing since it also refer to primary leagues where player are automatically enrolled.
image

I think a better fix would be to control the url /league/. I see 2 ways:

  1. always redirect it to /ladder/
  2. Admins should update the One primary league everymonth.

I guess 1 is better.

Change would happen here:

if event_id is None:
event = Registry.get_primary_event()

with much inspiration from:

def ladder(request):
"""A simple view that redirects to the last open ladder league."""
league = LeagueEvent.objects.filter(
event_type='ladder',
is_open=True,
community__isnull=True
).order_by('end_time').first()
return HttpResponseRedirect(reverse(
'league:results',
kwargs={'event_id': league.pk})
)

@angelsesma
Copy link
Contributor Author

thanks for the heads up! will give it a shot :)

@climu climu changed the title Bug: League game counter url broken confusion with both senses of primary leagues Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants