cesium-ml / baselayer

Fully customizable (scientific, compute-intensive) web application template
http://cesium-ml.org/baselayer/
30 stars 18 forks source link

User: bio and bot flag #383

Closed Theodlz closed 1 month ago

Theodlz commented 1 month ago

The idea of this PR is to add a bio field to the user model, as well as a bot flag (maybe should be renamed to is_bot to make the boolean-ness more obvious where we use it???).

it's nice in general to have a field for a user to store a bio that other users could access, and this will come in handy for a couple of applications:

Naturally, this will be followed by a SkyPortal PR which code is already written (the PR will be opened once this is merge to main).

stefanv commented 1 month ago

@Theodlz The is_bot field feels quite specific; should we add a JSONB meta column so you can add anything in there you want?

Theodlz commented 1 month ago

@stefanv the idea is that we really need a way to differentiate real user accounts, and bot accounts (that are used by scripts). On the contrary, I feel like having that in a JSONB doest make it obvious enough that this is not a normal account but a bot.

Does that make sense?

Theodlz commented 1 month ago

But I do agree that a JSONB is nice and flexible, and avoid opening other PRs in the future. In which case yes it could be a nice idea.

stefanv commented 1 month ago

I'm not sure I understand. I was thinking that baselayer is generic, and is_bot is a specialized request, meaning it may be better to have a JSONB column and to implement that functionality directly in SkyPortal (using the meta JSONB column).

Theodlz commented 1 month ago

Ok, I understand @stefanv . I think that we just have a different understand/view of this feature. I would argue that even the generic baselayer core would benefit from a way to distinguish API-only accounts from real users, but I might be wrong there.

Ultimately both options are really fine by me, so I'm happy to replace this by a JSONB column. Any suggestions for that column's name? Could be something like details?

stefanv commented 1 month ago

Probably not important enough to hold this PR up. Let's merge and can come back to it later, if we want.

stefanv commented 1 month ago

Let's rename to is_bot and merge.

Theodlz commented 1 month ago

done @stefanv.