Skip to content

Commit

Permalink
Fix flake8 errors on emails
Browse files Browse the repository at this point in the history
  • Loading branch information
say-yawn committed Aug 12, 2021
1 parent 1c76a38 commit 9aa604f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions emails/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from emails.utils import get_email_domain_from_settings

from django.conf import settings


def relay_from_domain(request):
return {'RELAY_DOMAIN': get_email_domain_from_settings()}
3 changes: 1 addition & 2 deletions emails/tests/models_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_make_relay_address_non_premium_user_cannot_pass_limit(self):
def test_make_relay_address_with_specified_domain(self):
relay_address = RelayAddress.make_relay_address(self.user_profile, domain='domain.com')
assert relay_address.domain == 'domain.com'

def test_delete_adds_deleted_address_object(self):
relay_address = baker.make(RelayAddress)
address_hash = sha256(
Expand Down Expand Up @@ -409,7 +409,6 @@ def test_display_name_does_not_exist(self):
)
profile = Profile.objects.get(user=social_account.user)
assert profile.display_name == None



class DomainAddressTest(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion emails/tests/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_get_email_domain_from_settings_on_heroku_test_mozmail_false(self):
def test_get_email_domain_from_settings_not_on_heroku_test_mozmail_false(self):
email_domain = get_email_domain_from_settings()
assert 'test.com' == email_domain

@override_settings(ON_HEROKU=True, ADDITIONAL_DOMAINS=['mozmail-test.com'], TEST_MOZMAIL=True)
def test_get_email_domain_from_settings_test_mozmail_true(self):
email_domain = get_email_domain_from_settings()
Expand Down
2 changes: 1 addition & 1 deletion emails/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def _get_address(to_address, local_portion, domain_portion):
# if the domain is not the site's 'top' relay domain,
# it may be for a user's subdomain
email_domains = settings.ADDITIONAL_DOMAINS + [get_email_domain_from_settings()]
if not domain_portion in email_domains:
if domain_portion not in email_domains:
return _get_domain_address(to_address, local_portion, domain_portion)

# the domain is the site's 'top' relay domain, so look up the RelayAddress
Expand Down

0 comments on commit 9aa604f

Please sign in to comment.