Skip to content

AttributeError: 'DiscountPercentage' object has no attribute 'amount' #6879

@frankie567

Description

@frankie567

Sentry Issue: SERVER-36T

Traceback (most recent call last):
  File "starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/server/.venv/lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/__init__.py", line 768, in __call__
    await self.app(scope, otel_receive, otel_send)
  File "starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "polar/kit/cors.py", line 55, in __call__
    await self.app(scope, receive, send)
  File "polar/middlewares.py", line 27, in __call__
    await self.app(scope, receive, send)
  File "polar/middlewares.py", line 72, in __call__
    await self.app(scope, receive, send)
  File "polar/postgres.py", line 67, in __call__
    await self.app(scope, receive, send)
  File "polar/middlewares.py", line 42, in __call__
    await self.app(scope, receive, send)
  File "polar/auth/middlewares.py", line 159, in __call__
    await self.app(scope, receive, send)
  File "ratelimit/core.py", line 96, in __call__
    return await self.app(scope, receive, send)
  File "polar/middlewares.py", line 106, in __call__
    await self.app(scope, receive, send_wrapper)
  File "starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
  File "starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
  File "starlette/routing.py", line 290, in handle
    await self.app(scope, receive, send)
  File "starlette/routing.py", line 78, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "starlette/routing.py", line 75, in app
    response = await f(request)
  File "fastapi/routing.py", line 302, in app
    raw_response = await run_endpoint_function(
  File "logfire/_internal/integrations/fastapi.py", line 143, in patched_run_endpoint_function
    return await instrumentation.run_endpoint_function(
  File "logfire/_internal/integrations/fastapi.py", line 301, in run_endpoint_function
    return await original
  File "fastapi/routing.py", line 213, in run_endpoint_function
    return await dependant.call(**values)
  File "polar/kit/routing.py", line 37, in wrapped_endpoint
    response = await endpoint(*args, **kwargs)
  File "polar/kit/routing.py", line 37, in wrapped_endpoint
    response = await endpoint(*args, **kwargs)
  File "polar/kit/routing.py", line 37, in wrapped_endpoint
    response = await endpoint(*args, **kwargs)
  File "polar/discount/endpoints.py", line 124, in update
    return await discount_service.update(session, discount, discount_update)
  File "polar/discount/service.py", line 253, in update
    if value != getattr(discount, attr):
AttributeError: 'DiscountPercentage' object has no attribute 'amount'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions