mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-09 04:13:33 +02:00
device: Throw a NoEnrolledPrints error if trying to delete a device with no prints
Adjust tests accordingly
This commit is contained in:
@ -184,6 +184,11 @@ def DeleteEnrolledFingers2(device):
|
||||
raise dbus.exceptions.DBusException(
|
||||
'Device was not claimed before use',
|
||||
name='net.reactivated.Fprint.Error.ClaimDevice')
|
||||
if not device.fingers[device.claimed_user]:
|
||||
raise dbus.exceptions.DBusException(
|
||||
'No enrolled prints in device {} for user {}'.format(device.path,
|
||||
device.claimed_user),
|
||||
name='net.reactivated.Fprint.Error.NoEnrolledPrints')
|
||||
device.fingers[device.claimed_user] = []
|
||||
|
||||
@dbus.service.method(DEVICE_IFACE,
|
||||
|
||||
Reference in New Issue
Block a user