Skip to content

Commit 7770b77

Browse files
committed
lint
1 parent 18d5f06 commit 7770b77

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backend/degree/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ def switch_rule(self, request, *args, **kwargs):
264264
if target_rule not in rule_to_degree:
265265
raise ValidationError({"rule_id": "Rule does not belong to this degree plan."})
266266

267-
if not target_rule.check_belongs(full_code) and target_rule not in fulfillment.overrides.all():
267+
is_overridden = target_rule in fulfillment.overrides.all()
268+
if not target_rule.check_belongs(full_code) and not is_overridden:
268269
raise ValidationError(
269270
{"rule_id": f"Course {full_code} does not satisfy rule {target_rule.id}"}
270271
)

0 commit comments

Comments
 (0)