Skip to content

Commit 6de7be6

Browse files
committed
Specified strip=False for another bunch of CharField form fields with Textarea widgets.
- Legacy-Id: 12711
1 parent fa60671 commit 6de7be6

21 files changed

Lines changed: 67 additions & 69 deletions

ietf/doc/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def clean(self, value):
8181
class DocumentForm(forms.ModelForm):
8282
states = StatesField(queryset=State.objects.all(), required=False)
8383
comment_about_changes = forms.CharField(
84-
widget=forms.Textarea(attrs={'rows':10,'cols':40,'class':'vLargeTextField'}),
84+
widget=forms.Textarea(attrs={'rows':10,'cols':40,'class':'vLargeTextField'}), strip=False,
8585
help_text="This comment about the changes made will be saved in the document history.")
8686

8787
def __init__(self, *args, **kwargs):

ietf/doc/views_ballot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def position_label(position_value):
9090
# -------------------------------------------------
9191
class EditPositionForm(forms.Form):
9292
position = forms.ModelChoiceField(queryset=BallotPositionName.objects.all(), widget=forms.RadioSelect, initial="norecord", required=True)
93-
discuss = forms.CharField(required=False, widget=forms.Textarea)
94-
comment = forms.CharField(required=False, widget=forms.Textarea)
93+
discuss = forms.CharField(required=False, widget=forms.Textarea, strip=False)
94+
comment = forms.CharField(required=False, widget=forms.Textarea, strip=False)
9595

9696
def __init__(self, *args, **kwargs):
9797
ballot_type = kwargs.pop("ballot_type")
@@ -414,7 +414,7 @@ def undefer_ballot(request, name):
414414
back_url=doc.get_absolute_url()))
415415

416416
class LastCallTextForm(forms.Form):
417-
last_call_text = forms.CharField(widget=forms.Textarea, required=True)
417+
last_call_text = forms.CharField(widget=forms.Textarea, required=True, strip=False)
418418

419419
def clean_last_call_text(self):
420420
lines = self.cleaned_data["last_call_text"].split("\r\n")
@@ -500,7 +500,7 @@ def lastcalltext(request, name):
500500
))
501501

502502
class BallotWriteupForm(forms.Form):
503-
ballot_writeup = forms.CharField(widget=forms.Textarea, required=True)
503+
ballot_writeup = forms.CharField(widget=forms.Textarea, required=True, strip=False)
504504

505505
def clean_ballot_writeup(self):
506506
return self.cleaned_data["ballot_writeup"].replace("\r", "")
@@ -592,7 +592,7 @@ def ballot_writeupnotes(request, name):
592592
))
593593

594594
class BallotRfcEditorNoteForm(forms.Form):
595-
rfc_editor_note = forms.CharField(widget=forms.Textarea, label="RFC Editor Note", required=True)
595+
rfc_editor_note = forms.CharField(widget=forms.Textarea, label="RFC Editor Note", required=True, strip=False)
596596

597597
def clean_rfc_editor_note(self):
598598
return self.cleaned_data["rfc_editor_note"].replace("\r", "")
@@ -643,7 +643,7 @@ def ballot_rfceditornote(request, name):
643643
))
644644

645645
class ApprovalTextForm(forms.Form):
646-
approval_text = forms.CharField(widget=forms.Textarea, required=True)
646+
approval_text = forms.CharField(widget=forms.Textarea, required=True, strip=False)
647647

648648
def clean_approval_text(self):
649649
return self.cleaned_data["approval_text"].replace("\r", "")

ietf/doc/views_charter.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
class ChangeStateForm(forms.Form):
3838
charter_state = forms.ModelChoiceField(State.objects.filter(used=True, type="charter"), label="Charter state", empty_label=None, required=False)
3939
initial_time = forms.IntegerField(initial=0, label="Review time", help_text="(in weeks)", required=False)
40-
message = forms.CharField(widget=forms.Textarea, help_text="Leave blank to change state without notifying the Secretariat.", required=False, label=mark_safe("Message to the Secretariat"))
41-
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the charter history.", required=False)
40+
message = forms.CharField(widget=forms.Textarea, help_text="Leave blank to change state without notifying the Secretariat.", required=False, label=mark_safe("Message to the Secretariat"), strip=False)
41+
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the charter history.", required=False, strip=False)
4242
def __init__(self, *args, **kwargs):
4343
self.hide = kwargs.pop('hide', None)
4444
group = kwargs.pop('group')
@@ -233,8 +233,8 @@ def state_pk(slug):
233233

234234
class ChangeTitleForm(forms.Form):
235235
charter_title = forms.CharField(widget=forms.TextInput, label="Charter title", help_text="Enter new charter title.", required=True)
236-
message = forms.CharField(widget=forms.Textarea, help_text="Leave blank to change the title without notifying the Secretariat.", required=False, label=mark_safe("Message to Secretariat"))
237-
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the charter history.", required=False)
236+
message = forms.CharField(widget=forms.Textarea, help_text="Leave blank to change the title without notifying the Secretariat.", required=False, label=mark_safe("Message to Secretariat"), strip=False)
237+
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the charter history.", required=False, strip=False)
238238
def __init__(self, *args, **kwargs):
239239
charter = kwargs.pop('charter')
240240
super(ChangeTitleForm, self).__init__(*args, **kwargs)
@@ -335,7 +335,7 @@ def edit_ad(request, name):
335335

336336

337337
class UploadForm(forms.Form):
338-
content = forms.CharField(widget=forms.Textarea, label="Charter text", help_text="Edit the charter text.", required=False)
338+
content = forms.CharField(widget=forms.Textarea, label="Charter text", help_text="Edit the charter text.", required=False, strip=False)
339339
txt = forms.FileField(label=".txt format", help_text="Or upload a .txt file.", required=False)
340340

341341
def clean_content(self):
@@ -454,15 +454,15 @@ def submit(request, name, option=None):
454454
})
455455

456456
class ActionAnnouncementTextForm(forms.Form):
457-
announcement_text = forms.CharField(widget=forms.Textarea, required=True)
457+
announcement_text = forms.CharField(widget=forms.Textarea, required=True, strip=False)
458458

459459
def clean_announcement_text(self):
460460
return self.cleaned_data["announcement_text"].replace("\r", "")
461461

462462

463463
class ReviewAnnouncementTextForm(forms.Form):
464-
announcement_text = forms.CharField(widget=forms.Textarea, required=True)
465-
new_work_text = forms.CharField(widget=forms.Textarea, required=True)
464+
announcement_text = forms.CharField(widget=forms.Textarea, required=True, strip=False)
465+
new_work_text = forms.CharField(widget=forms.Textarea, required=True, strip=False)
466466

467467
def clean_announcement_text(self):
468468
return self.cleaned_data["announcement_text"].replace("\r", "")
@@ -612,7 +612,7 @@ def action_announcement_text(request, name):
612612
))
613613

614614
class BallotWriteupForm(forms.Form):
615-
ballot_writeup = forms.CharField(widget=forms.Textarea, required=True)
615+
ballot_writeup = forms.CharField(widget=forms.Textarea, required=True, strip=False)
616616

617617
def clean_ballot_writeup(self):
618618
return self.cleaned_data["ballot_writeup"].replace("\r", "")

ietf/doc/views_conflict_review.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
class ChangeStateForm(forms.Form):
2626
review_state = forms.ModelChoiceField(State.objects.filter(used=True, type="conflrev"), label="Conflict review state", empty_label=None, required=True)
27-
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the review history.", required=False)
27+
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the review history.", required=False, strip=False)
2828

2929
@role_required("Area Director", "Secretariat")
3030
def change_state(request, name, option=None):
@@ -126,7 +126,7 @@ def send_conflict_eval_email(request,review):
126126
addrs.cc)
127127

128128
class UploadForm(forms.Form):
129-
content = forms.CharField(widget=forms.Textarea, label="Conflict review response", help_text="Edit the conflict review response.", required=False)
129+
content = forms.CharField(widget=forms.Textarea, label="Conflict review response", help_text="Edit the conflict review response.", required=False, strip=False)
130130
txt = forms.FileField(label=".txt format", help_text="Or upload a .txt file.", required=False)
131131

132132
def clean_content(self):
@@ -277,7 +277,7 @@ def default_approval_text(review):
277277

278278

279279
class AnnouncementForm(forms.Form):
280-
announcement_text = forms.CharField(widget=forms.Textarea, label="IETF Conflict Review Announcement", help_text="Edit the announcement message.", required=True)
280+
announcement_text = forms.CharField(widget=forms.Textarea, label="IETF Conflict Review Announcement", help_text="Edit the announcement message.", required=True, strip=False)
281281

282282
@role_required("Secretariat")
283283
def approve(request, name):

ietf/doc/views_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ def extract_name(s):
972972
return HttpResponse(json.dumps(data, indent=2), content_type='application/json')
973973

974974
class AddCommentForm(forms.Form):
975-
comment = forms.CharField(required=True, widget=forms.Textarea)
975+
comment = forms.CharField(required=True, widget=forms.Textarea, strip=False)
976976

977977
@role_required('Area Director', 'Secretariat', 'IRTF Chair', 'WG Chair', 'RG Chair', 'WG Secretary', 'RG Secretary', 'IANA', 'RFC Editor')
978978
def add_comment(request, name):

ietf/doc/views_draft.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
class ChangeStateForm(forms.Form):
4545
state = forms.ModelChoiceField(State.objects.filter(used=True, type="draft-iesg"), empty_label=None, required=True)
4646
substate = forms.ModelChoiceField(DocTagName.objects.filter(slug__in=IESG_SUBSTATE_TAGS), required=False)
47-
comment = forms.CharField(widget=forms.Textarea, required=False)
47+
comment = forms.CharField(widget=forms.Textarea, required=False, strip=False)
4848

4949
def clean(self):
5050
retclean = self.cleaned_data
@@ -210,7 +210,7 @@ def change_iana_state(request, name, state_type):
210210

211211
class ChangeStreamForm(forms.Form):
212212
stream = forms.ModelChoiceField(StreamName.objects.exclude(slug="legacy"), required=False)
213-
comment = forms.CharField(widget=forms.Textarea, required=False)
213+
comment = forms.CharField(widget=forms.Textarea, required=False, strip=False)
214214

215215
@login_required
216216
def change_stream(request, name):
@@ -292,7 +292,7 @@ def doc_ajax_internet_draft(request):
292292

293293
class ReplacesForm(forms.Form):
294294
replaces = SearchableDocAliasesField(required=False)
295-
comment = forms.CharField(widget=forms.Textarea, required=False)
295+
comment = forms.CharField(widget=forms.Textarea, required=False, strip=False)
296296

297297
def __init__(self, *args, **kwargs):
298298
self.doc = kwargs.pop('doc')
@@ -344,7 +344,7 @@ class SuggestedReplacesForm(forms.Form):
344344
replaces = forms.ModelMultipleChoiceField(queryset=DocAlias.objects.all(),
345345
label="Suggestions", required=False, widget=forms.CheckboxSelectMultiple,
346346
help_text="Select only the documents that are replaced by this document")
347-
comment = forms.CharField(label="Optional comment", widget=forms.Textarea, required=False)
347+
comment = forms.CharField(label="Optional comment", widget=forms.Textarea, required=False, strip=False)
348348

349349
def __init__(self, suggested, *args, **kwargs):
350350
super(SuggestedReplacesForm, self).__init__(*args, **kwargs)
@@ -404,7 +404,7 @@ def review_possibly_replaces(request, name):
404404

405405
class ChangeIntentionForm(forms.Form):
406406
intended_std_level = forms.ModelChoiceField(IntendedStdLevelName.objects.filter(used=True), empty_label="(None)", required=True, label="Intended RFC status")
407-
comment = forms.CharField(widget=forms.Textarea, required=False)
407+
comment = forms.CharField(widget=forms.Textarea, required=False, strip=False)
408408

409409
def change_intention(request, name):
410410
"""Change the intended publication status of a Document of type 'draft' , notifying parties
@@ -474,7 +474,7 @@ class EditInfoForm(forms.Form):
474474
ad = forms.ModelChoiceField(Person.objects.filter(role__name="ad", role__group__state="active",role__group__type='area').order_by('name'), label="Responsible AD", empty_label="(None)", required=True)
475475
create_in_state = forms.ModelChoiceField(State.objects.filter(used=True, type="draft-iesg", slug__in=("pub-req", "watching")), empty_label=None, required=False)
476476
notify = forms.CharField(max_length=255, label="Notice emails", help_text="Separate email addresses with commas.", required=False)
477-
note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False)
477+
note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False, strip=False)
478478
telechat_date = forms.TypedChoiceField(coerce=lambda x: datetime.datetime.strptime(x, '%Y-%m-%d').date(), empty_value=None, required=False, widget=forms.Select(attrs={'onchange':'make_bold()'}))
479479
returning_item = forms.BooleanField(required=False)
480480

@@ -812,7 +812,7 @@ def resurrect(request, name):
812812
back_url=doc.get_absolute_url()))
813813

814814
class IESGNoteForm(forms.Form):
815-
note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False)
815+
note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False, strip=False)
816816

817817
def clean_note(self):
818818
# not munging the database content to use html line breaks --
@@ -858,7 +858,7 @@ def edit_iesg_note(request, name):
858858
))
859859

860860
class ShepherdWriteupUploadForm(forms.Form):
861-
content = forms.CharField(widget=forms.Textarea, label="Shepherd writeup", help_text="Edit the shepherd writeup.", required=False)
861+
content = forms.CharField(widget=forms.Textarea, label="Shepherd writeup", help_text="Edit the shepherd writeup.", required=False, strip=False)
862862
txt = forms.FileField(label=".txt format", help_text="Or upload a .txt file.", required=False)
863863

864864
def clean_content(self):
@@ -1116,7 +1116,7 @@ def edit_consensus(request, name):
11161116

11171117
class PublicationForm(forms.Form):
11181118
subject = forms.CharField(max_length=200, required=True)
1119-
body = forms.CharField(widget=forms.Textarea, required=True)
1119+
body = forms.CharField(widget=forms.Textarea, required=True, strip=False)
11201120

11211121
def request_publication(request, name):
11221122
"""Request publication by RFC Editor for a document which hasn't
@@ -1210,7 +1210,7 @@ def request_publication(request, name):
12101210
class AdoptDraftForm(forms.Form):
12111211
group = forms.ModelChoiceField(queryset=Group.objects.filter(type__in=["wg", "rg"], state="active").order_by("-type", "acronym"), required=True, empty_label=None)
12121212
newstate = forms.ModelChoiceField(queryset=State.objects.filter(type__in=['draft-stream-ietf','draft-stream-irtf'],slug__in=['wg-cand', 'c-adopt', 'adopt-wg', 'info', 'wg-doc', 'candidat','active']),required=True,label="State")
1213-
comment = forms.CharField(widget=forms.Textarea, required=False, label="Comment", help_text="Optional comment explaining the reasons for the adoption.")
1213+
comment = forms.CharField(widget=forms.Textarea, required=False, label="Comment", help_text="Optional comment explaining the reasons for the adoption.", strip=False)
12141214
weeks = forms.IntegerField(required=False, label="Expected weeks in adoption state")
12151215

12161216
def __init__(self, *args, **kwargs):
@@ -1334,7 +1334,7 @@ def adopt_draft(request, name):
13341334
class ChangeStreamStateForm(forms.Form):
13351335
new_state = forms.ModelChoiceField(queryset=State.objects.filter(used=True), label='State' )
13361336
weeks = forms.IntegerField(label='Expected weeks in state',required=False)
1337-
comment = forms.CharField(widget=forms.Textarea, required=False, help_text="Optional comment for the document history.")
1337+
comment = forms.CharField(widget=forms.Textarea, required=False, help_text="Optional comment for the document history.", strip=False)
13381338
tags = forms.ModelMultipleChoiceField(queryset=DocTagName.objects.filter(used=True), widget=forms.CheckboxSelectMultiple, required=False)
13391339

13401340
def __init__(self, *args, **kwargs):

ietf/doc/views_material.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def choose_material_type(request, acronym):
3131
class UploadMaterialForm(forms.Form):
3232
title = forms.CharField(max_length=Document._meta.get_field("title").max_length)
3333
name = forms.CharField(max_length=Document._meta.get_field("name").max_length)
34-
abstract = forms.CharField(max_length=Document._meta.get_field("abstract").max_length,widget=forms.Textarea)
34+
abstract = forms.CharField(max_length=Document._meta.get_field("abstract").max_length,widget=forms.Textarea, strip=False)
3535
state = forms.ModelChoiceField(State.objects.all(), empty_label=None)
3636
material = forms.FileField(label='File')
3737

ietf/doc/views_review.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def assign_reviewer(request, name, request_id):
284284
})
285285

286286
class RejectReviewerAssignmentForm(forms.Form):
287-
message_to_secretary = forms.CharField(widget=forms.Textarea, required=False, help_text="Optional explanation of rejection, will be emailed to team secretary if filled in")
287+
message_to_secretary = forms.CharField(widget=forms.Textarea, required=False, help_text="Optional explanation of rejection, will be emailed to team secretary if filled in", strip=False)
288288

289289
@login_required
290290
def reject_reviewer_assignment(request, name, request_id):
@@ -354,7 +354,7 @@ class CompleteReviewForm(forms.Form):
354354

355355
review_url = forms.URLField(label="Link to message", required=False)
356356
review_file = forms.FileField(label="Text file to upload", required=False)
357-
review_content = forms.CharField(widget=forms.Textarea, required=False)
357+
review_content = forms.CharField(widget=forms.Textarea, required=False, strip=False)
358358
completion_date = DatepickerDateField(date_format="yyyy-mm-dd", picker_settings={ "autoclose": "1" }, initial=datetime.date.today, help_text="Date of announcement of the results of this review")
359359
completion_time = forms.TimeField(widget=forms.HiddenInput, initial=datetime.time.min)
360360
cc = MultiEmailField(required=False, help_text="Email addresses to send to in addition to the review team list")
@@ -621,7 +621,7 @@ def search_mail_archive(request, name, request_id):
621621
return JsonResponse(res)
622622

623623
class EditReviewRequestCommentForm(forms.ModelForm):
624-
comment = forms.CharField(widget=forms.Textarea)
624+
comment = forms.CharField(widget=forms.Textarea, strip=False)
625625
class Meta:
626626
fields = ['comment',]
627627
model = ReviewRequest

ietf/doc/views_status_change.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
class ChangeStateForm(forms.Form):
2727
new_state = forms.ModelChoiceField(State.objects.filter(type="statchg", used=True), label="Status Change Evaluation State", empty_label=None, required=True)
28-
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the review history.", required=False)
28+
comment = forms.CharField(widget=forms.Textarea, help_text="Optional comment for the review history.", required=False, strip=False)
2929

3030

3131
@role_required("Area Director", "Secretariat")
@@ -305,7 +305,7 @@ def default_approval_text(status_change,relateddoc):
305305
from django.forms.formsets import formset_factory
306306

307307
class AnnouncementForm(forms.Form):
308-
announcement_text = forms.CharField(widget=forms.Textarea, label="Status Change Announcement", help_text="Edit the announcement message.", required=True)
308+
announcement_text = forms.CharField(widget=forms.Textarea, label="Status Change Announcement", help_text="Edit the announcement message.", required=True, strip=False)
309309
label = None
310310

311311
def __init__(self, *args, **kwargs):

ietf/group/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def group_about_status_meeting(request, acronym, num, group_type=None):
481481
)
482482

483483
class StatusUpdateForm(forms.Form):
484-
content = forms.CharField(widget=forms.Textarea, label='Status update', help_text = 'Edit the status update', required=False)
484+
content = forms.CharField(widget=forms.Textarea, label='Status update', help_text = 'Edit the status update', required=False, strip=False)
485485
txt = forms.FileField(label='.txt format', help_text='Or upload a .txt file', required=False)
486486

487487
def clean_content(self):

0 commit comments

Comments
 (0)