Skip to content

Commit

Permalink
fix: Use (rfc, published) state for RFC SearchRules
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed Jul 11, 2023
1 parent 5385760 commit e42ac40
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ietf/community/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def restrict_state(state_type, slug=None):
if rule_type == "group_exp":
restrict_state("draft", "expired")
else:
restrict_state("draft", "rfc" if rule_type.endswith("rfc") else "active")
if rule_type.endswith("rfc"):
restrict_state("rfc", "published")
else:
restrict_state("draft", "active")

if rule_type.startswith("area"):
self.fields["group"].label = "Area"
Expand Down Expand Up @@ -70,7 +73,10 @@ def restrict_state(state_type, slug=None):
del self.fields["text"]

elif rule_type in ["author", "author_rfc", "shepherd", "ad"]:
restrict_state("draft", "rfc" if rule_type.endswith("rfc") else "active")
if rule_type.endswith("rfc"):
restrict_state("rfc", "published")
else:
restrict_state("draft", "active")

if rule_type.startswith("author"):
self.fields["person"].label = "Author"
Expand All @@ -84,7 +90,10 @@ def restrict_state(state_type, slug=None):
del self.fields["text"]

elif rule_type == "name_contains":
restrict_state("draft", "rfc" if rule_type.endswith("rfc") else "active")
if rule_type.endswith("rfc"):
restrict_state("rfc", "published")
else:
restrict_state("draft", "active")

del self.fields["person"]
del self.fields["group"]
Expand Down

0 comments on commit e42ac40

Please sign in to comment.