coco-annotator icon indicating copy to clipboard operation
coco-annotator copied to clipboard

Error when sharing dataset with a newly created user that hasn't logged in yet

Open mo-alaa opened this issue 4 years ago • 1 comments

When you create a user from the admin panel then you share a dataset with that user, the dataset will be corrupted, (and by corrupted I mean that you can't do the normal operations on the dataset, you can't even see who are the members of the dataset) UNTIL the newly created user logs in, once he logs in, the dataset becomes normal again; I will mention the steps below:

  1. Create a dataset (if you don't have an existing one already).

  2. Create a user from the admin panel and do not log in with that user for now.

  3. Share the dataset with the new user.

  4. Open the dataset, it will give you error, you can't even navigate between the dataset tabs! image

    When you click on any of these tabs, it actually gives this error in the console. image

Once you log in with that new user (log in from anywhere), the database becomes normal again.

Note: this has no difference if the newly created user is an admin not.

mo-alaa avatar Dec 26 '21 11:12 mo-alaa

seems like new users has not "last_seen" data, that lead to error...

I'll create pull/request after I have time to check code is correct. 😭😭😭

You can try to edit backend/database/users.py,Line 20

from

 last_seen = DateTimeField()

to

 last_seen = DateTimeField(defualt=datetime.datetime.now())

https://github.com/jsbroks/coco-annotator/blob/7c9992ce623b891c5dc208cd24451e51f0e76151/backend/database/users.py#L20

geminixiang avatar Dec 28 '21 19:12 geminixiang