-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Add default alias name to custom domain #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the PR is perfect! I just left some rather nitpicking comments :).
email_handler.py
Outdated
if alias.name: | ||
LOG.d("Put alias name in from header") | ||
from_header = formataddr((alias.name, alias.email)) | ||
else: | ||
from_header = alias.email | ||
elif alias_domain not in ALIAS_DOMAINS: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use alias.custom_domain_id
here I think. This field is filled up if the alias is dynamically created thanks to the directory feature.
We can also create a relationship like custom_domain = db.relationship("CustomDomain", foreign_keys=[custom_domain_id])
to avoid doing a CustomDomain.get()
, this is the same in terms of number of query to the database though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up adding the relationship in the model, this enabled me to display the domain-wide alias name as a placeholder in the alias view.
This does make alias.custom_domain_id redundant, but it has quite a few users left.
@SibrenVasse Thanks a lot for the PR! For the database migration, this requires having a If you have docker, you can create the migration by the following command: it first creates a postgres database for SimpleLogin, then run
|
The migration (up and down) ran successfully with your instructions. |
I've resolved your comments. |
@SibrenVasse perfect, thanks a lot! We'll test on staging and then deploy onto production today or tomorrow. |
Implementation for https://trello.com/c/dz9npgnw/66-able-to-set-alias-name-for-a-domain
The name in the from header is first set by the alias name, then the default alias name from the domain and otherwise not present.
Implementation runtime tested. I'm not sure if I did the migration correctly, as I could not find any documentation on this. I did my best to try and follow a similar style to the rest of the codebase. Let me know what you think.