Skip to content
Snippets Groups Projects

Resolve "Fix mypy errors in models.py and complete type hints"

All threads resolved!
2 files
+ 15
14
Compare changes
  • Side-by-side
  • Inline

Files

+ 14
13
@@ -1045,7 +1045,7 @@ out: List[Entity]
return p
else:
raise ValueError("pattern argument should be Entity, int or str")
raise ValueError("`pattern` argument should be an Entity, int or str.")
return None
@@ -3966,7 +3966,7 @@ class Container(list):
else:
entity._checksum = None
# FIXME: The signature of Conatiner.insert is completely different than the superclass'
# FIXME: The signature of Container.insert is completely different than the superclass'
# list.insert method. This may be a problem in the future, but is ignored for now.
def insert( # type: ignore
self,
@@ -3981,20 +3981,23 @@ class Container(list):
identified, retrieved, updated, and deleted via this ID until it has
been deleted.
If the insertion fails, a LinkAheadException will be raised. The server will have returned at
least one error-message describing the reason why it failed in that case (call
If the insertion fails, a LinkAheadException will be raised. The server will have returned
at least one error-message describing the reason why it failed in that case (call
<this_entity>.get_all_messages() in order to get these error-messages).
Some insertions might cause warning-messages on the server-side, but the entities are inserted
anyway. Set the flag 'strict' to True in order to force the server to take all warnings as errors.
This prevents the server from inserting this entity if any warning occurs.
Some insertions might cause warning-messages on the server-side, but the entities are
inserted anyway. Set the flag 'strict' to True in order to force the server to take all
warnings as errors. This prevents the server from inserting this entity if any warning
occurs.
@param strict=False: Flag for strict mode.
@param sync=True: synchronize this container with the response from the server. Otherwise,
this method returns a new container with the inserted entities and leaves this container untouched.
@param unique=True: Flag for unique mode. If set to True, the server will check if the name of the
entity is unique. If not, the server will return an error.
this method returns a new container with the inserted entities and leaves
this container untouched.
@param unique=True: Flag for unique mode. If set to True, the server will check if the name
of the entity is unique. If not, the server will return an error.
@param flags=None: Additional flags for the server.
"""
self.clear_server_messages()
@@ -4264,9 +4267,7 @@ class ACI():
e.set("role", self.role)
else:
if self.username is None:
raise LinkAheadException(
"An ACI must have either a role or a username."
)
raise LinkAheadException("An ACI must have either a role or a username.")
e.set("username", self.username)
if self.realm is not None:
Loading