Skip to content

Commit

Permalink
Updates based on feedback of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
kushaldas committed Aug 29, 2019
1 parent eebe892 commit 1c3e5f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions admin/securedrop_admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def validate(self, document):
# is already disabled.
if text == 'no' and \
not self.caller._config.get("v2_onion_services"):
raise ValidationError(message="Must be yes as you disabled v2")
raise ValidationError(message="Since you disabled v2 onion services, you must enable v3 onion services.") # noqa: E501
if text == 'yes' or text == 'no':
return True
raise ValidationError(message="Must be either yes or no")
Expand Down Expand Up @@ -423,12 +423,12 @@ def __init__(self, args):
string.split,
lambda config: True],
['v2_onion_services', self.check_for_v2_onion(), bool,
u'Do you want to enable v2 onion services?',
u'Do you want to enable v2 onion services (recommended only for SecureDrop instances installed before 1.0.0)?', # noqa: E501
SiteConfig.ValidateYesNo(),
lambda x: x.lower() == 'yes',
lambda config: True],
['v3_onion_services', self.check_for_v3_onion, bool,
u'Do you want to enable new v3 onion services?',
u'Do you want to enable v3 onion services (recommended)?',
SiteConfig.ValidateYesNoForV3(self),
lambda x: x.lower() == 'yes',
lambda config: True],
Expand Down
6 changes: 3 additions & 3 deletions admin/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,17 @@ def verify_locales_prompt(child):


def verify_v2_onion_for_first_time(child):
child.expect(r'Do you want to enable v2 onion services\?\:', timeout=2) # noqa: E501
child.expect(r' installed before 1.0.0\)\?\:', timeout=2) # noqa: E501
assert ANSI_ESCAPE.sub('', child.buffer) == ' no' # Expected default


def verify_v3_onion_for_first_time(child):
child.expect(r'Do you want to enable new v3 onion services\?\:', timeout=2)
child.expect(r'Do you want to enable v3 onion services \(recommended\)\?\:', timeout=2) # noqa: E501
assert ANSI_ESCAPE.sub('', child.buffer) == ' yes' # Expected default


def verify_v3_onion_when_v2_is_enabled(child):
child.expect(r'Do you want to enable new v3 onion services\?\:', timeout=2)
child.expect(r'Do you want to enable v3 onion services \(recommended\)\?\:', timeout=2) # noqa: E501
assert ANSI_ESCAPE.sub('', child.buffer) == ' yes' # Expected default


Expand Down

0 comments on commit 1c3e5f8

Please sign in to comment.