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

Display a nice page when registration is not available #409

Open
MasloMaslane opened this issue Oct 8, 2024 · 2 comments
Open

Display a nice page when registration is not available #409

MasloMaslane opened this issue Oct 8, 2024 · 2 comments
Assignees

Comments

@MasloMaslane
Copy link
Member

Display a nice page when registration is not available because of RegistrationAvailabilityConfig instead of 403

@MasloMaslane
Copy link
Member Author

When RegistrationAvailabilityConfig is configured in contest settings so that the registration is not yet available
image
trying to register to a contest (/c/contest_id/register/) gives a 403 error. This is not informative enough, instead there should be a page that "Registration is not (yet) available"

@Aadameqq Aadameqq self-assigned this Oct 25, 2024
@Mateuszciesla1 Mateuszciesla1 self-assigned this Jan 8, 2025
@Aadameqq Aadameqq removed their assignment Jan 9, 2025
@twalen
Copy link
Contributor

twalen commented Jan 13, 2025

I suggest to also fix small bug in the RegistrationAvailabilityConfig:

--- a/oioioi/contests/models.py
+++ b/oioioi/contests/models.py
@@ -410,7 +410,7 @@ class RegistrationAvailabilityConfig(models.Model):
             if self.registration_available_from is None or self.registration_available_to is None:
                 raise ValidationError(_("If registration availability is set to Configuration, then "
                                         "'Available from' and 'Available to' must be set."))
-            if self.available_from > self.registration_available_to:
+            if self.registration_available_from > self.registration_available_to:
                 raise ValidationError(_("'Available from' must be before 'available to'."))

Mateuszciesla1 added a commit that referenced this issue Jan 20, 2025
…new template.

-- Fixed a minor bug in `models.py`.
Mateuszciesla1 added a commit that referenced this issue Jan 20, 2025
…new template.

-- Fixed a minor bug in `models.py`.
twalen pushed a commit that referenced this issue Feb 14, 2025
…new template. -- Fixed a minor bug in `models.py`. (#458)

* -- Resolved issue #409 with a new method `registration_status` and a new template.
-- Fixed a minor bug in `models.py`.

* Update settings.py.template

* -- Resolved issue #409 with a new method `registration_status` and a new template.
-- Fixed a minor bug in `models.py`.
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

4 participants