After logging as not allowed user, one gets redirected to dashboard.
Dashboard view uses @enforce_condition(can_enter_contest), which throws 403.
Same behaviour may be observed while trying to change contest to one we're not participant of.
With only_default_contest situation is worse, as user have no easy way to logout.
Proposed fix:
write @gently_enforce_condition decorator, which on False will show nice page saying user has no access there.
Page template shall probably inherit just after base.html
Maciej Dębski
added a comment - After logging as not allowed user, one gets redirected to dashboard.
Dashboard view uses @enforce_condition(can_enter_contest), which throws 403.
Same behaviour may be observed while trying to change contest to one we're not participant of.
With only_default_contest situation is worse, as user have no easy way to logout.
Proposed fix:
write @gently_enforce_condition decorator, which on False will show nice page saying user has no access there.
Page template shall probably inherit just after base.html
Alternative fix:
In RegistrationController, and possibly other places make can_enter_contest return AccessDenied decision with rendered response instead of bool.
Maciej Dębski
added a comment - Alternative fix:
In RegistrationController, and possibly other places make can_enter_contest return AccessDenied decision with rendered response instead of bool.
Dashboard view uses @enforce_condition(can_enter_contest), which throws 403.
Same behaviour may be observed while trying to change contest to one we're not participant of.
With only_default_contest situation is worse, as user have no easy way to logout.
Proposed fix:
write @gently_enforce_condition decorator, which on False will show nice page saying user has no access there.
Page template shall probably inherit just after base.html