Skip to content

Commit

Permalink
Simplify access checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 committed Jun 12, 2024
1 parent 9e11bd0 commit bd6bf8e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions i18n_demo/indico_i18n_demo/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
from indico.modules.categories.models.categories import Category
from indico.modules.categories.operations import create_category as _create_category
from indico.modules.events.cloning import get_event_cloners
from indico.modules.events.controllers.base import RHEventBase
from indico.modules.events.controllers.base import RHProtectedEventBase
from indico.modules.events.operations import clone_event
from indico.web.flask.util import url_for


class RHCloneEvent(RHEventBase):
class RHCloneEvent(RHProtectedEventBase):
"""Clone an event to a user's personal category.
If the category does not exist, it will be created.
Expand All @@ -30,9 +30,6 @@ def _process(self):
if not (category_id := current_plugin.settings.get('test_category_id')):
raise BadRequest('No test category ID configured')

if not session.user:
raise Forbidden('You must be logged in to clone events')

test_category = Category.get(int(category_id))
user_category = get_user_category(test_category, session.user)

Expand Down

0 comments on commit bd6bf8e

Please sign in to comment.