##// END OF EJS Templates
ux: fix bug where saving empty issue tracker form was causing...
dan -
r1000:dbebf42b default
parent child Browse files
Show More
@@ -397,10 +397,11 b' class SettingsController(BaseController)'
397 397 settings_model = IssueTrackerSettingsModel()
398 398
399 399 form = IssueTrackerPatternsForm()().to_python(request.POST)
400 for uid in form['delete_patterns']:
400 if form:
401 for uid in form.get('delete_patterns', []):
401 402 settings_model.delete_entries(uid)
402 403
403 for pattern in form['patterns']:
404 for pattern in form.get('patterns', []):
404 405 for setting, value, type_ in pattern:
405 406 sett = settings_model.create_or_update_setting(
406 407 setting, value, type_)
@@ -494,6 +494,14 b' class TestAdminSettingsIssueTracker:'
494 494 response = self.app.get(url('admin_settings_issuetracker'))
495 495 assert response.status_code == 200
496 496
497 def test_add_empty_issuetracker_pattern(
498 self, request, autologin_user, csrf_token):
499 post_url = url('admin_settings_issuetracker_save')
500 post_data = {
501 'csrf_token': csrf_token
502 }
503 self.app.post(post_url, post_data, status=302)
504
497 505 def test_add_issuetracker_pattern(
498 506 self, request, autologin_user, csrf_token):
499 507 pattern = 'issuetracker_pat'
General Comments 0
You need to be logged in to leave comments. Login now