Fix for #768 (If email server is configured, admins can send user passwords, also domains can be denied from registration)

Fixes from tests
Fix response opds with read/unread
changed db_reconnect
Changed output for error 500 (now including error message)
Fix in task queue after 20 messages
This commit is contained in:
Ozzieisaacs
2020-01-01 17:29:01 +01:00
parent b586a32843
commit 513ac6cfb4
13 changed files with 2128 additions and 3312 deletions
+5 -1
View File
@@ -38,7 +38,7 @@ class _Settings(_Base):
__tablename__ = 'settings'
id = Column(Integer, primary_key=True)
mail_server = Column(String, default='mail.example.org')
mail_server = Column(String, default=constants.DEFAULT_MAIL_SERVER)
mail_port = Column(Integer, default=25)
mail_use_ssl = Column(SmallInteger, default=0)
mail_login = Column(String, default='mail@example.com')
@@ -189,6 +189,10 @@ class _ConfigSQL(object):
def get_mail_settings(self):
return {k:v for k, v in self.__dict__.items() if k.startswith('mail_')}
def get_mail_server_configured(self):
return not bool(self.mail_server == constants.DEFAULT_MAIL_SERVER)
def set_from_dictionary(self, dictionary, field, convertor=None, default=None):
'''Possibly updates a field of this object.
The new value, if present, is grabbed from the given dictionary, and optionally passed through a convertor.