ynput / ayon-backend

Server codebase with API access to AYON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attributes: Greater than (gt) does not work

Innders opened this issue · comments

To reproduce

Steps to reproduce the behavior:

  1. Go to /settings/attributes
  2. Edit or create new attribute
  3. Set gt value to 0 or 0.5.
  4. Do not set ge

Expected behavior

When setting the value in the scope, anything below or equal to gt should throw an error.
ge, lt, le seem to work.

Discovered whilst doing Attributes: Min and max values

I was not able to reproduce it. It seems to work alright (apart from the fact the error message should be friendlier).

BTW GT/GTE switch in the attribute editor is not available for integers? only for decimals?

image

BTW GT/GTE switch in the attribute editor is not available for integers? only for decimals?

I believe that's correct looking at @Innders 's answer here.

On experimental, setting -1 on pizzaShare won't throw an error.

(Just realised this is GE, but that still doesn't work)

image
image

image

Interesting. You are not sending a number, but a string. My wild guess is that implicit type conversions somehow mess with the validation. Normally this should return a type error as "-1" is not a value that could be compared to a number. but Pydantic apparently tries to do some type casting there and fails.