schema.py 542 B

123456789101112131415161718
  1. from pydantic import HttpUrl
  2. from glitchtip.schema import CamelSchema
  3. class ImportIn(CamelSchema):
  4. url: HttpUrl
  5. auth_token: str
  6. organization_slug: str
  7. # def __init__(self, context, *args, **kwargs):
  8. # if user := context["request"].user:
  9. # self.fields[
  10. # "organizationSlug"
  11. # ].queryset = user.organizations_ext_organization.filter(
  12. # organization_users__role__gte=OrganizationUserRole.ADMIN
  13. # )
  14. # return super().__init__(*args, **kwargs)