```
try:
    pv = RolePropertyValue.objects.get(
        property=p,
        device=device,
    )
except RolePropertyValue.DoesNotExist:
    pass
else:
    pv.delete()
```