Projet

Général

Profil

0001-hobo-digest-emails-parameters-sent-by-hobo-46779.patch

Valentin Deniaud, 02 novembre 2020 17:30

Télécharger (2,17 ko)

Voir les différences:

Subject: [PATCH] hobo: digest emails parameters sent by hobo (#46779)

 tests/test_hobo.py     | 5 +++++
 wcs/ctl/check_hobos.py | 8 ++++++++
 2 files changed, 13 insertions(+)
tests/test_hobo.py
200 200
    'email_signature': 'Hello world.',
201 201
    'default_from_email': 'noreply@example.net',
202 202
    'theme': 'clapotis-les-canards',
203
    'sms_url': 'http://passerelle.example.net',
204
    'sms_sender': 'EO',
203 205
  },
204 206
  'users': [
205 207
    {
......
251 253
    assert pub.cfg['misc']['sitename'] == 'Test wcs'
252 254
    assert pub.cfg['emails']['footer'] == 'Hello world.'
253 255
    assert pub.cfg['emails']['from'] == 'noreply@example.net'
256
    assert pub.cfg['sms']['passerelle_url'] == 'http://passerelle.example.net'
257
    assert pub.cfg['sms']['mode'] == 'passerelle'
258
    assert pub.cfg['sms']['sender'] == 'EO'
254 259

  
255 260

  
256 261
def test_update_themes():
wcs/ctl/check_hobos.py
161 161

  
162 162
        if not pub.cfg.get('emails'):
163 163
            pub.cfg['emails'] = {}
164
        if not pub.cfg.get('sms'):
165
            pub.cfg['sms'] = {}
164 166

  
165 167
        variables = self.all_services.get('variables') or {}
166 168
        variables.update(service.get('variables') or {})
......
214 216
        if variables.get('email_signature') is not None:
215 217
            pub.cfg['emails']['footer'] = force_str(variables.get('email_signature'))
216 218

  
219
        if variables.get('sms_url'):
220
            pub.cfg['sms']['passerelle_url'] = force_str(variables.get('sms_url'))
221
            pub.cfg['sms']['mode'] = 'passerelle'
222
        if variables.get('sms_sender'):
223
            pub.cfg['sms']['sender'] = force_str(variables.get('sms_sender'))
224

  
217 225
        pub.write_cfg()
218 226

  
219 227
    def update_profile(self, profile, pub):
220
-