Recover / restore a deleted event

Is there away to recover/restore a deleted event?

indico event restore ID on the command line

Thank you. Found the bin at /opt/indico/.venv/bin and was able to restore event with suggested command. indico event restore ID

The command is directly available in your $PATH when you activate the venv (source ~/.venv/bin/activate) :wink:

I’ve save request from a user, the problem is he doesn’t know the id of the event, only the short url.
Is they are any way to just list all deleted event title to find the id ?

thanks

Yes, you can use Event.query.filter_by(url_shortcut='foo').first().id to query it in indico shell.

You could also filter by is_deleted=True and look at the titles etc.

Thanks for the tips, but in fact I got a another “issue”, the guy also deleted the category, so when I try to restore the event but he tell me

DETAIL:  Event inside deleted category

I’ve hesitate to do something (I’m not «very» familiar with python) in indico shell

fubar = Event.query.filter_by(id=844).first()
fubar.category=ID_NOT_DELETED

But I don’t want to mess up with the database…

So basically how can I change the category of a deleted event ?

Is they are anyway to restore a category ?

This should restore the category:

event = Event.get(844)
event.category.is_deleted = False
db.session.commit()

Afterwards you should be able to restore the event as well

Thanks a lot. Work perfectly