Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
rref #5367
Browse files Browse the repository at this point in the history
  • Loading branch information
evrenesat committed Jul 10, 2016
1 parent cde1d94 commit 877e78e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ulakbus/models/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ class Unit(Model):
uid = field.Integer(index=True)
parent = LinkProxy('Unit', verbose_name='Üst Birim', reverse_name='alt_birimler')


@classmethod
def get_user_keys(cls, current, unit_key):
return cls(current).objects.filter(unit_id=unit_key).values_list('user_id', flatten=True)

class Meta:
app = 'Sistem'
verbose_name = "Unit"
Expand Down
5 changes: 5 additions & 0 deletions ulakbus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
PERMISSION_MODEL = 'ulakbus.models.auth.Permission'
USER_MODEL = 'ulakbus.models.auth.User'
ROLE_MODEL = 'ulakbus.models.auth.Role'
UNIT_MODEL = 'ulakbus.models.auth.Unit'

# # left blank to use StreamHandler aka stderr
# LOG_HANDLER = os.environ.get('LOG_HANDLER', 'file')
#
Expand Down Expand Up @@ -231,3 +233,6 @@

#: User search method of messaging subsystem will work on these fields
MESSAGING_USER_SEARCH_FIELDS = ['username', ]

#: Unit search method of messaging subsystem will work on these fields
MESSAGING_UNIT_SEARCH_FIELDS = ['name',]

0 comments on commit 877e78e

Please sign in to comment.