Infer configparser getter from field type

This commit is contained in:
Guewen Baconnier 2018-07-24 13:39:22 +02:00 committed by Adrien Peiffer
parent 92a34e9cb5
commit 2f21a345f9
No known key found for this signature in database
GPG Key ID: D9266D898B218452
2 changed files with 5 additions and 15 deletions

View File

@ -15,21 +15,13 @@ class FetchmailServer(models.Model):
base_fields = super()._server_env_fields
mail_fields = {
"server": {},
"port": {
"getter": "getint",
},
"port": {},
"type": {},
"user": {},
"password": {},
"is_ssl": {
"getter": "getbool",
},
"attach": {
"getter": "getbool",
},
"original": {
"getter": "getbool",
},
"is_ssl": {},
"attach": {},
"original": {},
}
mail_fields.update(base_fields)
return mail_fields

View File

@ -13,9 +13,7 @@ class IrMailServer(models.Model):
base_fields = super()._server_env_fields
mail_fields = {
"smtp_host": {},
"smtp_port": {
"getter": "getint",
},
"smtp_port": {},
"smtp_user": {},
"smtp_pass": {},
"smtp_encryption": {},