Re: [mezzanine-users] Need some help with assigning user site permission in a view

2016-07-21 Thread zruu
Thank you man! This helped me out A LOT! Cheers! Den torsdag 21 juli 2016 kl. 23:20:24 UTC+2 skrev Ryne Everett: > > Ah, that makes sense. I guess you can't pass ManyToManyField's in the > constructor. Try: > > siteperms = SitePermissions.objects.create(user=user) >

Re: [mezzanine-users] Need some help with assigning user site permission in a view

2016-07-21 Thread Ryne Everett
Ah, that makes sense. I guess you can't pass ManyToManyField's in the constructor. Try: siteperms = SitePermissions.objects.create(user=user) siteperms.sites.add(site) On Thu, Jul 21, 2016 at 5:15 PM, zruu wrote: > Hi Ryne, > > Thanks for the quick reply. That was

Re: [mezzanine-users] Need some help with assigning user site permission in a view

2016-07-21 Thread zruu
Hi Ryne, Thanks for the quick reply. That was what I was looking for. I have a form on the front end that a user can create a site, and a user account at the same time. I want to automate this to minimize the administration as possible. However I tried that, and I got the error: 'sites' is

Re: [mezzanine-users] Need some help with assigning user site permission in a view

2016-07-21 Thread Ryne Everett
SitePermission.objects.create(user=user, sites=(site,)) I question whether this is really what you want to do, but without a better idea what your goal is it's all I can offer. On Thu, Jul 21, 2016 at 4:56 PM, zruu wrote: > Hey guys, > > I really need your help. I'm

[mezzanine-users] Need some help with assigning user site permission in a view

2016-07-21 Thread zruu
Hey guys, I really need your help. I'm stuck at the moment. Maybe is too late. However. I need to in my class view add site permission instead of using through the admin. I have no clue how to do this. I looked through the Mezzanine code and all I found was this piece of code that looks