Skip to content

Commit

Permalink
Merge pull request #82 from plone/cast-smtp_port-to-int
Browse files Browse the repository at this point in the history
Cast smtp port to int
  • Loading branch information
jensens authored Aug 26, 2016
2 parents df96abf + 465df48 commit bc7ad4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ New features:

Bug fixes:

- *add item here*
- Be sure smtp_port is an integer.
[ale-rt]


1.3.27 (2016-08-16)
Expand Down
4 changes: 3 additions & 1 deletion plone/app/upgrade/v50/betas.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def upgrade_mail_controlpanel_settings(context):
mail_settings.smtp_host = unicode(smtp_host)

smtp_port = getattr(portal.MailHost, 'smtp_port', 25)
mail_settings.smtp_port = smtp_port
# It may happen that smtp_port is a string, maybe empty,
# but we need an integer here to match the record constraints
mail_settings.smtp_port = int(smtp_port or 25)

smtp_user_id = portal.MailHost.get('smtp_user_id')
mail_settings.smtp_user_id = smtp_user_id
Expand Down

0 comments on commit bc7ad4d

Please sign in to comment.