-
Notifications
You must be signed in to change notification settings - Fork 378
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
fix: restore ability to create status change documents #5963
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5963 +/- ##
==========================================
- Coverage 88.67% 88.64% -0.04%
==========================================
Files 288 288
Lines 40001 40003 +2
==========================================
- Hits 35471 35459 -12
- Misses 4530 4544 +14
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a purely stylistic matter, I tend to prefer "truthy" tests like if status_change.ad
vs. if status_change.ad is not None
or {% if not doc.ad %}
vs. {% if doc.ad is None %}
.
That said, it appears to do what it says on the label.
I've been getting pressure to make more explicit checks, particularly in templates, when the real point of consideration is whether the thing is None or not. In this particular case, I don't think it makes a difference, but if someone configured an AD with a str that returned "", there are other kinds of conditionals or use of {{ ad }} that would likely do the wrong thing. |
As a source of this pressure, I prefer it because it distinguishes the absence of value from the possible presence of a value that happens to evaluate as It's a little tricky in templates sometimes - Django represents the absence of a value in some of its fields (like |
In #5962, you said
Are you satisfied with having looked over that for this PR or should we plan that inspection separately? |
I'm not really satisfied, but I did make a quick pass through looking for case-sensitivity troubles. I think this particular fail was a late surprise because of the way we test forms (poking hand-written POST values in that may not actually reflect what a browser would have provided exercising the defined form). So I think it's enough of an edge that we move on, and watch for a framework that works that would allow more of an integrated test of the use of the form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggested syntax change to consider, but looks good to me.
ietf/doc/views_status_change.py
Outdated
@@ -685,7 +685,7 @@ def last_call(request, name): | |||
form = LastCallTextForm(initial=dict(last_call_text=escape(last_call_event.text))) | |||
|
|||
if request.method == 'POST': | |||
if "save_last_call_text" in request.POST or "send_last_call_request" in request.POST: | |||
if "save_last_call_text" in request.POST or "send_last_call_request" in request.POST and status_change.ad is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parentheses might be in order here - this is if A or (B and C):
I think, which makes sense but it'd help readability to make the intent more explicit
Fixes #5962