How to use the accesscontrol.models.User.objects function in AccessControl

To help you get started, we’ve selected a few AccessControl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joaohenriquef / rfid-access-control / server / accesscontrol / services.py View on Github external
def get_current_tag_owner(uid):
    from accesscontrol.models import User
    not_expired_users = User.objects.filter(rfidtaguserlink__expire_date__gte=datetime.date.today())
    never_expire_users = User.objects.filter(rfidtaguserlink__expire_date__isnull=True)
    all_valid_users = not_expired_users | never_expire_users

    print(all_valid_users)
    return all_valid_users.get(rfid_tag__uid=uid.lower())
github joaohenriquef / rfid-access-control / server / accesscontrol / services.py View on Github external
def get_current_tag_owner(uid):
    from accesscontrol.models import User
    not_expired_users = User.objects.filter(rfidtaguserlink__expire_date__gte=datetime.date.today())
    never_expire_users = User.objects.filter(rfidtaguserlink__expire_date__isnull=True)
    all_valid_users = not_expired_users | never_expire_users

    print(all_valid_users)
    return all_valid_users.get(rfid_tag__uid=uid.lower())