throat icon indicating copy to clipboard operation
throat copied to clipboard

Adds feature to let users opt-in to have notifications forwarded via email.

Open why-not-try-calmer opened this issue 2 years ago • 1 comments

Adds feature to let users opt-in to have notifications forwarded via email.

why-not-try-calmer avatar Aug 19 '22 10:08 why-not-try-calmer

@Polsaker May I ask for your opinion on this one? Since this will require more works (i.e. tests and some polish) I'd like to know beforehand if it's shaping into something you could find acceptable.

why-not-try-calmer avatar Aug 20 '22 07:08 why-not-try-calmer

Sorry for the delay, this looks good to merge now

Polsaker avatar Feb 19 '23 20:02 Polsaker

Sorry for the delay, this looks good to merge now

Thanks, let me know if there's some post-merge work to do on that in case you'd get some feedbacks from users.

why-not-try-calmer avatar Feb 19 '23 23:02 why-not-try-calmer

There was a missing migration that I already added. Will let you know if anything else happens

Polsaker avatar Feb 19 '23 23:02 Polsaker

@why-not-try-calmer in app/config.py can you maybe make allow_email_forwarded_notifications a part of configurable_defaults instead of defaults? This way we don't have to mess with it inside config.yaml (we also now miss an updated example.config.yaml, by the way).

Thanks!

globalistas avatar Feb 26 '23 09:02 globalistas

Sounds like a reasonable request.

why-not-try-calmer avatar Feb 26 '23 09:02 why-not-try-calmer

For now I'm testing with the config.yaml option set to True and getting:

Traceback (most recent call last):
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/flask/app.py", line 2531, in wsgi_app
    response = self.handle_exception(e)
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/home/app/ceknito/app/views/user.py", line 331, in edit_user
    return engine.get_template("user/settings/preferences.html").render(
  File "/home/app/ceknito/app/misc.py", line 136, in render
    result = super(TemplateWithLogging, self).render(ctx)
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/wheezy/template/engine.py", line 28, in render
    return self.render_template(ctx, {}, {})
  File "user/settings/preferences.html", line 64, in render
  File "/home/app/.pyenv/versions/app/lib/python3.9/site-packages/wheezy/template/engine.py", line 70, in render
    return self.renders[name](ctx, local_defs, super_defs)
  File "shared/layout.html", line 178, in render
  File "shared/layout.html", line 169, in content
  File "user/settings/preferences.html", line 39, in main
AttributeError: 'EditUserForm' object has no attribute 'email_forwarded_notifications'

BTW my testing branch is here, maybe I didn't merge something correctly? https://github.com/globalistas/ceknito/tree/newemail

globalistas avatar Feb 26 '23 09:02 globalistas

After I've managed to fix my pending PR, we can look more into it.

why-not-try-calmer avatar Feb 26 '23 10:02 why-not-try-calmer

After I've managed to fix my pending PR, we can look more into it.

Seeing as your pending PR is still not fixed, can you maybe advise on the above error so that I can at least use your previous PR (and the other PRs introduced since then by Polsaker)?

globalistas avatar Mar 08 '23 05:03 globalistas