Hi All,
I need help with assigning a user to a specific site in my class view. I
don't know how the approach would be. I saw in the database that the table
is *core_sitepermissions* *core_sitepermissions_sites*. Right after I
created the site object I run into problems.
form = self.form_class(request.POST)
if form.is_valid():
user = form.save(commit=False)
username = form.cleaned_data['username']
password = form.cleaned_data['password']
user.set_password(password)
user.is_staff = True
user.save()
g = Group.objects.get(name='group_one')
g.user_set.add(user)
site = Site.objects.create(
domain='%s.%s' % (username, settings.
NETWORK_DOMAIN),
name='%s.%s' % (username, settings.
NETWORK_DOMAIN))
user_site = Site.objects.get(domain='%s.%s' % (username,
settings.NETWORK_DOMAIN))
u = User.objects.get(username=username)
u.site = user_site
u.save()
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.