Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling login breaks sending emails #179

Open
gravesm opened this issue Nov 26, 2019 · 0 comments
Open

Disabling login breaks sending emails #179

gravesm opened this issue Nov 26, 2019 · 0 comments

Comments

@gravesm
Copy link

gravesm commented Nov 26, 2019

Turning off login for the app, which is the default state, breaks sending emails:

if os.environ.get('DJANGO_LOGIN_REQUIRED') == 'True':
# You can't actually set a Boolean environment variable, just a string.
LOGIN_REQUIRED = True
else:
LOGIN_REQUIRED = False

Without auth, the anonymous user has no email attribute:

email.send(self.request.user.email)

Given that sending emails is the core functionality of the application, it doesn't seem useful to me for the app to really ever be run in a situation when emails aren't processed. Whether emails actually get sent or not should be handled by configuring the emailing backend.

The proper solution is probably just to always have auth enabled. In general, there are way too many switches for running this application in dev vs prod. The more we can do to make the app run the same everywhere and just be configured by env vars the better.

@hakbailey hakbailey mentioned this issue Jan 28, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant