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

Add filter for external calendar #3295

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

JoeyStk
Copy link
Contributor

@JoeyStk JoeyStk commented Dec 17, 2024

Short description

This PR adds a filter for external calendars to the event list view. It only makes sense to merge this PR once we decide to "go live" with the external calendar feature.

Proposed changes

  • Add two checkboxes to filter for imported events or for not imported events

Side effects

None?

Resolved issues

Fixes: #3102


Pull Request Review Guidelines

Comment on lines +162 to +170
if (
calendar.EVENT_NOT_FROM_EXTERNAL_CALENDAR
in self.cleaned_data["imported_event"]
):
events = events.filter(external_calendar__isnull=True)
elif (
calendar.EVENT_FROM_EXTERNAL_CALENDAR in self.cleaned_data["imported_event"]
):
events = events.filter(external_calendar__isnull=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means the default behavior is that only non-imported events are shown, since both checkboxes are checkbed by default, but only the first case applies.

For me the expected behavior would be:

  • Both checked: No filter applied
  • One checked: Filter either for has external calendar or has no external calendar
  • None checked: I guess this would be invalid and treated as both checked, like for the other checkboxes?

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

Successfully merging this pull request may close these issues.

iCal: Add filter to event list to filter for imported events & not imported events
2 participants