publisher: reset site options when changing appdir (#31016)
This commit is contained in:
parent
78799be562
commit
b7625dd101
|
@ -262,6 +262,7 @@ def test_is_url_signed_check_nonce(pub, local_user):
|
|||
|
||||
pub.site_options.add_section('api-secrets')
|
||||
pub.site_options.set('api-secrets', ORIG, KEY)
|
||||
pub.site_options.write(open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w'))
|
||||
# test clean_nonces do not bark when nonces directory is empty
|
||||
if os.path.exists(os.path.join(pub.app_dir, 'nonces')):
|
||||
shutil.rmtree(os.path.join(pub.app_dir, 'nonces'))
|
||||
|
|
|
@ -480,6 +480,7 @@ class QommonPublisher(Publisher, object):
|
|||
'''
|
||||
Set the application directory, creating it if possible and authorized.
|
||||
'''
|
||||
self.site_options = None # reset at the beginning of a request
|
||||
canonical_hostname = request.get_server(clean = False).lower().split(':')[0].rstrip('.')
|
||||
for prefix in ['mobile', 'm']:
|
||||
if canonical_hostname.startswith(prefix + '.') or \
|
||||
|
|
Loading…
Reference in New Issue