We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e868ba0 commit 7866113Copy full SHA for 7866113
renku/core/models/provenance/agents.py
@@ -58,9 +58,14 @@ class Person:
58
@_id.default
59
def default_id(self):
60
"""Set the default id."""
61
+ import string
62
if self.email:
63
return 'mailto:{email}'.format(email=self.email)
- return '_:{}'.format(''.join(self.name.lower().split()))
64
+
65
+ # prep name to be a valid rdf string
66
+ name = self.name.translate(str.maketrans('', '', string.punctuation))
67
+ name = ''.join(filter(lambda x: x in string.printable, name))
68
+ return '_:{}'.format(''.join(name.lower().split()))
69
70
@email.validator
71
def check_email(self, attribute, value):
0 commit comments