mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 05:00:20 +00:00
pep8
This commit is contained in:
parent
442734ff9e
commit
a8ed93a4b5
3 changed files with 3 additions and 14 deletions
|
@ -469,7 +469,7 @@ class AuthHandler(BaseHandler):
|
||||||
def _get_params_terms(self):
|
def _get_params_terms(self):
|
||||||
return {
|
return {
|
||||||
"policies": {
|
"policies": {
|
||||||
"privacy_policy": {
|
"privacy_policy": {
|
||||||
"version": self.hs.config.user_consent_version,
|
"version": self.hs.config.user_consent_version,
|
||||||
"en": {
|
"en": {
|
||||||
"name": "Privacy Policy",
|
"name": "Privacy Policy",
|
||||||
|
|
|
@ -158,9 +158,6 @@ class AuthRestServlet(RestServlet):
|
||||||
defer.returnValue(None)
|
defer.returnValue(None)
|
||||||
elif stagetype == LoginType.TERMS:
|
elif stagetype == LoginType.TERMS:
|
||||||
session = request.args['session'][0]
|
session = request.args['session'][0]
|
||||||
authdict = {
|
|
||||||
'session': session,
|
|
||||||
}
|
|
||||||
|
|
||||||
html = TERMS_TEMPLATE % {
|
html = TERMS_TEMPLATE % {
|
||||||
'session': session,
|
'session': session,
|
||||||
|
|
|
@ -359,19 +359,11 @@ class RegisterRestServlet(RestServlet):
|
||||||
[LoginType.MSISDN, LoginType.EMAIL_IDENTITY]
|
[LoginType.MSISDN, LoginType.EMAIL_IDENTITY]
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Append m.login.terms to all flows if we're requiring consent
|
||||||
if self.hs.config.block_events_without_consent_error is not None:
|
if self.hs.config.block_events_without_consent_error is not None:
|
||||||
new_flows = []
|
new_flows = []
|
||||||
for flow in flows:
|
for flow in flows:
|
||||||
# To only allow registration if completing GDPR auth,
|
|
||||||
# making clients that don't support it use fallback auth.
|
|
||||||
flow.append(LoginType.TERMS)
|
flow.append(LoginType.TERMS)
|
||||||
|
|
||||||
# or to duplicate all the flows above with the GDPR flow on the
|
|
||||||
# end so clients that support it can use it but clients that don't
|
|
||||||
# continue to consent via the DM from server notices bot.
|
|
||||||
#new_flows.extend([
|
|
||||||
# flow + [LoginType.TERMS]
|
|
||||||
#])
|
|
||||||
flows.extend(new_flows)
|
flows.extend(new_flows)
|
||||||
|
|
||||||
auth_result, params, session_id = yield self.auth_handler.check_auth(
|
auth_result, params, session_id = yield self.auth_handler.check_auth(
|
||||||
|
@ -461,7 +453,7 @@ class RegisterRestServlet(RestServlet):
|
||||||
)
|
)
|
||||||
|
|
||||||
if auth_result and LoginType.TERMS in auth_result:
|
if auth_result and LoginType.TERMS in auth_result:
|
||||||
logger.info("User %s has consented to the privacy policy" % registered_user_id)
|
logger.info("%s has consented to the privacy policy" % registered_user_id)
|
||||||
yield self.store.user_set_consent_version(
|
yield self.store.user_set_consent_version(
|
||||||
registered_user_id, self.hs.config.user_consent_version,
|
registered_user_id, self.hs.config.user_consent_version,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue