Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/deseng 444: Engagement Metadata API #2362

Merged
merged 19 commits into from
Jan 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[sonarcloud] Fix unused f-strings and assignment
NatSquared committed Jan 24, 2024
commit 3a1b1c50aa45e90cb29f83e10b5c4c73230aa681
4 changes: 2 additions & 2 deletions met-api/src/met_api/services/authorization.py
Original file line number Diff line number Diff line change
@@ -50,11 +50,11 @@ def _validate_tenant(eng_id, tenant_id):
return
engagement_tenant_id = EngagementModel.find_tenant_id_by_id(eng_id)
if engagement_tenant_id and str(tenant_id) != str(engagement_tenant_id):
current_app.logger.debug(f'Aborting . Tenant Id on Engagement and user context Mismatch\n'
current_app.logger.debug('Aborting . Tenant Id on Engagement and user context Mismatch\n'
f'engagement_tenant_id:{engagement_tenant_id}\n'
f'tenant_id: {tenant_id}')

abort(HTTPStatus.FORBIDDEN, f'User not authorized')
abort(HTTPStatus.FORBIDDEN, 'User not authorized')


def _has_team_membership(kwargs, user_from_context, team_permitted_roles) -> bool:
Original file line number Diff line number Diff line change
@@ -113,7 +113,6 @@ def create_for_engagement(self, engagement_id: int, metadata: dict = {}, **kwarg
@staticmethod
def create_defaults(engagement_id: int, tenant_id:int) -> list[dict]:
"""Create default metadata for an engagement."""
engagement_id = engagement_id
# Get metadata taxa for the tenant
taxa = MetadataTaxon.query.filter_by(tenant_id=tenant_id).all()
# Create a list of metadata to create