Username Error After LMS Install

I just installed LMS on an existing site and I started getting the error Username can only contain alphabets, numbers and underscore.

A lot of usernames are user emails and some of the emails are firstname.lastname@email.com. This error popped up only after LMS was installed. Has anyone encountered this? If yes, how did you resolve it?

@flexy2ky when does this error appear?

If you try to update a user after installing LMS that error will pop up.

Is this an existing user, or are you trying to create a new user.

Existing users whose email addresses are in this format name.name@email.com will throw that error if you try to update any information in their user profile.

Hi @flexy2ky

I am also looking to install the new Frappe-LMS so I am curious…
Did you install this on an ERPNExt server V14 or V13 ?

I installed it on ERPNext v14.

@flexy2ky can you raise a GitHub issue for the same here GitHub - frappe/lms: Easy to Use, 100% Open Source Learning Management System

Good day

Has there perhaps been any progress ito a fix for this ?

Also, @flexy2ky if a I may ask, does this error also occur when you create a user after you
installed the LMS ? I have a V14 server now and want to install LMS

I’ve raised GitHub issues severally in the past and I find that none of them receive any response so I don’t think I’ll bother on that one. If they see the issue here (which I believe they do) and they think it’s worth looking at then they will look at it and fins a way to resolve it. The issue is with this method:

I created override of that file and disabled that function to overcome the issue but this is a terrible way of addressing it especially as the file itself overrides the User document class.

It occurs if you’re creating a new user and the user’s email is in this format: name.name@mail.com or if you’re editing a user whose email is in the same format.

Thank you for your message @flexy2ky

It does seem as if you have identified the problem. Hopefully the developers could pick
it up from your comments and notes and have a look at it.

I am in the process of migrating all my servers from V13 to V14 and want to try this LMS.
Would it be possible for you to provide some detail of the fix you implemented ? I would
like to not break my existing system.

Perhaps you could also provide some insight on another point …
The install procedure for this LMS suggests the creation of another site. Which means that if I
install it on an existing ERPNext site, I will have to enable multi tenancy?

Thank you

I simply commented out the function from the validate function to disable the check because “.” was not included in regex = re.compile(r"[@!#$%^&*()<>?/|}{~:-]") and I didn’t want to spend time trying to refactor the function as the glitch was affecting my production instance so I simply disabled the check and I have not gone back there ever since.

No you don’t have to do this as it is installed as any other app/module you install like HRMS. One thing to note though, once you install it all user home is automatically set as the default home for LMS. so you have to then click on your name and Switch to Desk in order to access your ERPNext modules. I have tried to find a way around this and i saw they had added a setting in the LMS Settings to disable this behaviour but it doesn’t seem to work.

Thank you @flexy2ky for your comments. I really do appreciate it.

It is sad to read about your frustration because there are many users , and this includes you,
that make detail observations and tests / checks to narrow down a problem and this in itself
would be a great help to someone that has to fix a problem.

I to have submitted issues that is rather urgent but my knowledge of python is still limited.
In fact I am considering paid assistance, but I suspect that would be quite pricy.

let me see how things go as I install LMS on my new V14 server.

Thanks again.

Good day @flexy2ky

Just an update …

I went ahead and installed LMS on my server but I am unable to replicate the errors that are
popping up on your system.

I would be happy to compare notes if it could clear up the issue.

Here with my system specs

Ecommerce Integrations: v1.15.4 (main)
Education: v0.0.1 (develop)
ERPNext: v14.24.3 (version-14)
Frappe Framework: v14.36.1 (version-14)
Frappe HR: v15.0.0-dev (develop)
Frappe LMS: v0.0.1 (main)

The procedure I followed was …

I also installed

payments
payroll
hrms
ecommerce-integrations
education

and then I installed LMS

My initial user account did not contain a period in the email-account but I did create another
account with a first.second@gmail.com. The creation went fine. I also checked the error log.

Update

I do confirm that any users created after the installation of LMS is in fact Website user.
Even though “System User” is selected when the user is created.

Edit…
But I am able to change it to a system user when logged in as Admin or System manager
and then changing the “Website USer” setting to “System User” and also selecting at least
one role. ( System Manager)

@flexy2ky This PR will fix the issue you face. You can update your website and check.