troubles with user creation / deletion

24 views
Skip to first unread message

Vincent Delecroix

unread,
Sep 21, 2015, 1:41:06 AM9/21/15
to sage-notebook
Hello,

I have a script to automatically create users from text files that is
attached. But I currently have some troubles with it. I used to do the
following

from sagenb.notebook.notebook import load_notebook
nb = load_notebook(MY_DIR)
U = nb.user_manager()
U.add_user(NAME, PASS, MAIL, force=True)
nb.save()

Is that the right procedure? To delete a user it is basically the same
with U.delete_user(NAME). Is that fine as well?

1. Once I delete a user, if I try to login I ended up on a blank page!
Whereas if the login name is wrong I get an error message like "username
not in the database" within the login page.

2. The method to create one user works fine if I do it from the Sage
console. Though, if I launch the script the result is very strange: I
can see the users from the console (i.e. they appear in U.usernames())
but if I try to login in the notebook it says "username not in the
database".

Any insight for 1 or 2 would be appreciated.

Thanks!
Vincent

PS: My server is running Sage 6.1.1 with sagenb-0.10.8.2
script_users.py

Andrey Novoseltsev

unread,
Sep 21, 2015, 7:11:58 PM9/21/15
to sage-notebook
I had recently a similar issue (6.9.beta4):

- deleted a user through the web interface
- the user was gone
- later tried to add the same user (again through the web interface) and got an error that this name is already taken
- the user however appeared in the system

Not sure how does it affect (or depends on) this user worksheets - I had to move on and didn't investigate further.

20100.d...@gmail.com

unread,
Sep 21, 2015, 8:58:14 PM9/21/15
to sage-notebook
Some more input on my side: I was able to make my script works if I *do not use* the character '-'. This is incredible!

kcrisman

unread,
Sep 22, 2015, 3:34:41 AM9/22/15
to sage-notebook

Some more input on my side: I was able to make my script works if I *do not use* the character '-'. This is incredible!

This sounds familiar w.r.t. the notebook.  But are you using the ASCII - character or a related character for a dash/hyphen/...?  That also has caused problems.
Reply all
Reply to author
Forward
0 new messages