mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[FIX] base_suspend_security: Pretend to be a list of ints if neccessary
This commit is contained in:
@@ -14,3 +14,16 @@ class BaseSuspendSecurityUid(int):
|
||||
|
||||
def __iter__(self):
|
||||
yield super(BaseSuspendSecurityUid, self).__int__()
|
||||
|
||||
def __len__(self):
|
||||
return 1
|
||||
|
||||
def __getitem__(self, key):
|
||||
int_value = super().__int__()
|
||||
if isinstance(key, slice):
|
||||
if key.start > 0:
|
||||
return ()
|
||||
return (int_value,)
|
||||
if key != 0:
|
||||
raise IndexError
|
||||
return int_value
|
||||
|
||||
Reference in New Issue
Block a user