Hello Everyone,

I've been working on a Django/SCT powered website for a game we've
been writing at my college, and we want to tie the game regsitration
in with the registration function on the website.  The authentication
system for the game is already fully implemented, so we're doing the
integration by having them share a database and using table joins or
dual-insert/queries to authenticate. (Haven't really decided which.)

My first attempt was to add my own mysql select module to django/
contrib/auth/forms.py that checks against the game's database for
existing usernames before allowing registration, but when I
implemented the change, nothing happened when I registered with a name
that already exists in the game database.

#The modified module in auth/forms.py
    def clean_username(self):
        username = self.cleaned_data["username"]
        try:
             User.objects.get(username=username)
        except User.DoesNotExist:
             exists = selectuser.select("account_name", username,
"Account")
             if not exists:
                  return username
             else:
                  raise Exception("A user with that username already
exists.")
        raise forms.ValidationError(_("A user with that username
already exists."))

I've already confirmed that my module returns the username from the
game database if it exists, and it seems to work fine.  I'm not sure
if I'm even using it in the right location though, I added a couple of
checks to see if this function is even called on registration and it
doesn't seem to be used at all (which seems wrong judging by the
code).

Anyhow, I was wondering if I'm completely off  on the location to be
editing, or if there was something else I'm doing wrong.

Thanks,
--Exolun

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to