Skip to content

Fix exception flow: omit if_has_tag when "restrict to same tag" is unchecked#1491

Merged
inducer merged 2 commits intomainfrom
copilot/create-exception-flow-fix
Apr 30, 2026
Merged

Fix exception flow: omit if_has_tag when "restrict to same tag" is unchecked#1491
inducer merged 2 commits intomainfrom
copilot/create-exception-flow-fix

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

When creating an exception flow with "only sessions with this tag" unchecked, the generated rule included if_has_tag: null instead of omitting the field entirely, causing validation/matching issues.

Changes

  • course/views.py: For both access and grading exception rules, conditionally include if_has_tag only when restricted_to_same_tag is True, rather than always emitting the key with a null value.

Before:

new_access_rule_json = {
    "permissions": [...],
    "if_has_tag": session.access_rules_tag if restricted_to_same_tag else None,
}

After:

new_access_rule_json = {
    "permissions": [...],
}
if restricted_to_same_tag:
    new_access_rule_json["if_has_tag"] = session.access_rules_tag

Same pattern applied to new_grading_rule_json.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix exception flow for unchecked tag sessions Fix exception flow: omit if_has_tag when "restrict to same tag" is unchecked Apr 30, 2026
Copilot AI requested a review from inducer April 30, 2026 15:07
@inducer inducer marked this pull request as ready for review April 30, 2026 17:29
@inducer inducer enabled auto-merge (rebase) April 30, 2026 17:29
@inducer inducer merged commit 16b33c2 into main Apr 30, 2026
18 checks passed
@inducer inducer deleted the copilot/create-exception-flow-fix branch April 30, 2026 17:38
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.

Create exception flow: doesn't work if "only sessions with this tag" is unchecked

2 participants