Skip to content

Commit

Permalink
Merge pull request bread-and-pepper#373 from amarandon/fix-guardian-i…
Browse files Browse the repository at this point in the history
…mport-warning

Update import from guardian
  • Loading branch information
wunki committed Feb 26, 2014
2 parents 602b39c + 0eda744 commit e32d702
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions userena/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
get_user_model
from userena import signals as userena_signals

from guardian.shortcuts import assign, get_perms
from guardian.shortcuts import assign_perm, get_perms


import re, datetime

Expand Down Expand Up @@ -75,11 +76,11 @@ def create_user(self, username, email, password, active=False,

# Give permissions to view and change profile
for perm in ASSIGNED_PERMISSIONS['profile']:
assign(perm[0], new_user, new_profile)
assign_perm(perm[0], new_user, new_profile)

# Give permissions to view and change itself
for perm in ASSIGNED_PERMISSIONS['user']:
assign(perm[0], new_user, new_user)
assign_perm(perm[0], new_user, new_user)

if send_email:
userena_profile.send_activation_email()
Expand Down Expand Up @@ -281,7 +282,7 @@ def check_permissions(self):

for perm in perms:
if perm[0] not in all_permissions:
assign(perm[0], user, perm_object)
assign_perm(perm[0], user, perm_object)
changed_users.append(user)

return (changed_permissions, changed_users, warnings)
Expand Down

0 comments on commit e32d702

Please sign in to comment.