I have People
app. I have Person
model that has username
field. When I add a person and that person does not have an account yet, I click the little plus sign next to the username
field and I'm presented with a New User form.
That is okay.
Now I want to create users in this manner: The username should be in a form of {firstname}.{lastname}[.{serial}]
fo that John Smith will have username john.smith
and another John Smith would be john.smith.1
.
How can I pass the firstname and lastname to the new user form? Also: How to check if there's another user with that username and append the serial number to it?
Thank you