1818 SecretKey ,
1919)
2020from parsec .email_rate_limit import EmailRateLimit
21+ from parsec .templates import get_environment
2122
2223if TYPE_CHECKING :
2324 from parsec .components .memory .organization import MemoryOrganization , OrganizationID
@@ -252,7 +253,7 @@ class OpenBaoConfig:
252253@dataclass (slots = True , kw_only = True )
253254class BackendConfig :
254255 debug : bool
255- jinja_env : Environment
256+ jinja_env : Environment = field ( default_factory = lambda : get_environment ( None ))
256257 db_config : BaseDatabaseConfig
257258 blockstore_config : BaseBlockStoreConfig
258259 email_config : SmtpEmailConfig | MockedEmailConfig
@@ -266,11 +267,11 @@ class BackendConfig:
266267 # Bearer token used to authenticate the administration API
267268 administration_token : str
268269
269- # Minimal wait time (in seconds) between two email having the same recipient or initiator IP address
270- email_rate_limit_cooldown_delay : int
271- # Maximum number of mail send per hour for any given recipient or initiator IP address
272- # Note setting it to `0` disable the check.
273- email_rate_limit_max_per_hour : int
270+ # Minimal wait time (in seconds) between two emails having the same recipient or initiator IP address
271+ email_rate_limit_cooldown_delay : int = 0
272+ # Maximum number of mails sent per hour for any given recipient or initiator IP address
273+ # Note setting it to `0` disables the check.
274+ email_rate_limit_max_per_hour : int = 0
274275 # Small hack here: since the rate limit system is purely in-memory and configured
275276 # only by fields from this class, we instantiate here to simplify passing it
276277 # to the different components needing it.
0 commit comments