Skip to content

Commit 154fc9f

Browse files
committed
Use underscores in param names
1 parent 96953b2 commit 154fc9f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tests/unit/manage/test_views.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def test_delete_project_release(self, monkeypatch):
232232
project=pretend.stub(name='foobar'),
233233
)
234234
request = pretend.stub(
235-
POST={'confirm-version': release.version},
235+
POST={'confirm_version': release.version},
236236
method="POST",
237237
db=pretend.stub(
238238
delete=pretend.call_recorder(lambda a: None),
@@ -286,7 +286,7 @@ def test_delete_project_release_no_confirm(self):
286286
project=pretend.stub(name='foobar'),
287287
)
288288
request = pretend.stub(
289-
POST={'confirm-version': ''},
289+
POST={'confirm_version': ''},
290290
method="POST",
291291
db=pretend.stub(delete=pretend.call_recorder(lambda a: None)),
292292
route_path=pretend.call_recorder(lambda *a, **kw: '/the-redirect'),
@@ -321,7 +321,7 @@ def test_delete_project_release_bad_confirm(self):
321321
project=pretend.stub(name='foobar'),
322322
)
323323
request = pretend.stub(
324-
POST={'confirm-version': 'invalid'},
324+
POST={'confirm_version': 'invalid'},
325325
method="POST",
326326
db=pretend.stub(delete=pretend.call_recorder(lambda a: None)),
327327
route_path=pretend.call_recorder(lambda *a, **kw: '/the-redirect'),

warehouse/manage/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ def manage_project_release(self):
133133

134134
@view_config(
135135
request_method="POST",
136-
request_param=["confirm-version"]
136+
request_param=["confirm_version"]
137137
)
138138
def delete_project_release(self):
139-
version = self.request.POST.get('confirm-version')
139+
version = self.request.POST.get('confirm_version')
140140
if not version:
141141
self.request.session.flash(
142142
"Must confirm the request.", queue='error'

warehouse/templates/manage/release.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ <h3 class="modal__title">Delete Release {{ release.version }}?</h3>
123123
<p>Warning: This action cannot be undone!</p>
124124
</div>
125125
<p>Confirm the release version to continue.</p>
126-
<label for="confirm-version">Release version</label>
127-
<input name="confirm-version" type="text" placeholder="Confirm version" autocomplete="off" autocorrect="off" autocapitalize="off">
126+
<label for="confirm_version">Release version</label>
127+
<input name="confirm_version" type="text" placeholder="Confirm version" autocomplete="off" autocorrect="off" autocapitalize="off">
128128
</div>
129129
<div class="modal__footer">
130130
<a href="#modal-close" class="button modal__action">Cancel</a>

0 commit comments

Comments
 (0)