Skip to content

Commit

Permalink
Merge pull request #77 from libris/bugfix/isnot
Browse files Browse the repository at this point in the history
Logic error, fixes #76
  • Loading branch information
mblomdahl authored Oct 26, 2017
2 parents 86b824f + ce585bd commit 20f4dfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xl_auth/permission/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ def validate(self):
return False

other_permission = Permission.query.filter(
Permission.id.isnot(target_permission.id)).filter_by(
user_id=self.user_id.data, collection_id=self.collection_id.data).first()
Permission.id != target_permission.id,
Permission.user_id == self.user_id.data,
Permission.collection_id == self.collection_id.data
).first()
if other_permission:
self.user_id.errors.append(_(
'Permissions for user "%(username)s" on collection "%(code)s" already registered',
Expand Down

0 comments on commit 20f4dfb

Please sign in to comment.