fix: Use (rfc, published) state for RFC SearchRules

This commit is contained in:
Jennifer Richards 2023-07-11 16:16:05 -03:00
parent 5385760f2a
commit e42ac40ec4
No known key found for this signature in database
GPG key ID: 9B2BF5C5ADDA6A6E

View file

@ -42,7 +42,10 @@ class SearchRuleForm(forms.ModelForm):
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"
@ -70,7 +73,10 @@ class SearchRuleForm(forms.ModelForm):
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"
@ -84,7 +90,10 @@ class SearchRuleForm(forms.ModelForm):
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"]