Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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())
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())
from django.urls import path
from accesscontrol import admin
from accesscontrol import views
urlpatterns = [
path('request-unlock', views.request_unlock),
path('authenticate', views.authenticate),
path('authorize-visitor', views.authorize_visitor),
path('request-front-door-unlock', views.request_front_door_unlock),
]
from django.urls import path
from accesscontrol import admin
from accesscontrol import views
urlpatterns = [
path('request-unlock', views.request_unlock),
path('authenticate', views.authenticate),
path('authorize-visitor', views.authorize_visitor),
path('request-front-door-unlock', views.request_front_door_unlock),
]
from django.urls import path
from accesscontrol import admin
from accesscontrol import views
urlpatterns = [
path('request-unlock', views.request_unlock),
path('authenticate', views.authenticate),
path('authorize-visitor', views.authorize_visitor),
path('request-front-door-unlock', views.request_front_door_unlock),
]
from django.urls import path
from accesscontrol import admin
from accesscontrol import views
urlpatterns = [
path('request-unlock', views.request_unlock),
path('authenticate', views.authenticate),
path('authorize-visitor', views.authorize_visitor),
path('request-front-door-unlock', views.request_front_door_unlock),
]