diff --git a/http-api/app/rules/user.py b/http-api/app/rules/user.py index 677d37f..a598751 100644 --- a/http-api/app/rules/user.py +++ b/http-api/app/rules/user.py @@ -195,10 +195,11 @@ def set_email_as_primary( ) transact.update( key=KeyPair(id, '0'), - update_expr='SET email = :email, email_verified = :email_verified, \ - updated_at = :updated_at', + update_expr='DELETE emails :email_set SET email = :email, \ + email_verified = :email_verified, updated_at = :updated_at', expr_attr_values={ ':email': new_email, + ':email_set': {new_email}, ':email_verified': email_verified, ':updated_at': now_, }, diff --git a/http-api/template.yaml b/http-api/template.yaml index b1af4e3..96575e1 100644 --- a/http-api/template.yaml +++ b/http-api/template.yaml @@ -26,7 +26,7 @@ Globals: Architectures: - x86_64 Layers: - - !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:79 + - !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:80 Environment: Variables: TZ: America/Sao_Paulo @@ -38,8 +38,6 @@ Globals: ORDER_TABLE: !Ref OrderTable ENROLLMENT_TABLE: !Ref EnrollmentTable COURSE_TABLE: !Ref CourseTable - ELASTIC_CLOUD_ID: "{{resolve:ssm:/betaeducacao/elastic/cloud_id/str}}" - ELASTIC_AUTH_PASS: "{{resolve:ssm:/betaeducacao/elastic/auth_pass/str}}" KONVIVA_API_URL: https://lms.saladeaula.digital KONVIVA_SECRET_KEY: "{{resolve:ssm:/betaeducacao/konviva/secret_key/str}}" MEILISEARCH_HOST: https://meili.eduseg.com.br diff --git a/streams-events/app/events/index_docs_into_meili.py b/streams-events/app/events/index_docs_into_meili.py index d5e5197..e1297be 100644 --- a/streams-events/app/events/index_docs_into_meili.py +++ b/streams-events/app/events/index_docs_into_meili.py @@ -34,7 +34,7 @@ def table_from_arn(arn: str) -> str: return arn_.resource.split('/')[0] -# Post-migration: remove the following line +# Post-migration: remove the following lines def sanitize(obj): if isinstance(obj, dict): return {k.replace(':', '__'): sanitize(v) for k, v in obj.items()}