
    "zZh                     X    S SK r S SKrS SKrS SKJr  SrSr\R                  " \SS9  S rg)    N)
encode_imgzapp/images/zapp/facial_attendance_db.dbT)exist_okc           	         [         R                  R                  U 5      (       d  [        SU  S35        g[	        U 5      nUcF  [        S5        [         R                  R                  U 5      (       a  [         R
                  " U 5        g [        R                  " [        5       nUR                  5       nUR                  SU[        R                  " UR                  5       5      U 45        UR                  5         [        SU S35         S S S 5        g! , (       d  f       g= f! [        R                   aL    [        S	U S
35        [         R                  R                  U 5      (       a  [         R
                  " U 5         g[          aU  n[        SU SU 35        [         R                  R                  U 5      (       a  [         R
                  " U 5         S nAgS nAff = f)NzError: Image path 'z' does not exist.Fz0Error: No encodings found in the provided image.z?INSERT INTO users (name, encoding, image_path) VALUES (?, ?, ?)zUser 'z' registered successfully.TzError: User with the name 'z' already exists.z Error: Unable to register user 'z'. Details: )ospathexistsprintr   removesqlite3connectAPP_DB_FILEcursorexecutejsondumpstolistcommitIntegrityError	Exception)user_image_path	user_nameencoded_img_dataconnr   es         >D:\DownLoads\facial_attendance_system-main\app\registration.pyregister_userr      su   77>>/**#O#44EFG!/2@A77>>/**IIo&'__[)T[[]FNNQDJJ'7'>'>'@A?S KKMF9+%?@A *))"  !! '+I;6GHI77>>/**IIo&
 	  '0<sKL77>>/**IIo&	's?   
D& $A(DD& 
D#D& #D& &AG#	G#AGG#)	r   r   r   	app.utilsr   
IMAGES_DIRr   makedirsr        r   <module>r"      s0     	    
+ J &r!   