403Webshell
Server IP : 65.108.144.40  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User : dev ( 1000)
PHP Version : 8.2.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/erp/biometric/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/biometric/context_processors.py
"""
Utility functions related to biometric attendance.

This file contains utility functions related to biometric attendance,
including a function to check if the biometric system is installed.

Functions:
    biometric_is_installed(request): Checks if the biometric system is installed.
"""

from base.models import BiometricAttendance


def biometric_is_installed(_request):
    """
    Check if the biometric system is installed.

    This function checks if the biometric system is installed by querying the
    BiometricAttendance model. If no BiometricAttendance object exists, it
    creates one with 'is_installed' set to False.

    Args:
        request: The HTTP request object.

    Returns:
        dict: A dictionary containing a single key-value pair indicating whether
        the biometric system is installed. The key is 'is_installed', and the value
        is a boolean indicating the installation status.
    """
    instance = BiometricAttendance.objects.first()
    if not instance:
        BiometricAttendance.objects.create(is_installed=False)
        instance = BiometricAttendance.objects.first()
    is_installed = instance.is_installed
    return {"is_installed": is_installed}

Youez - 2016 - github.com/yon3zu
LinuXploit