-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
record: User resource creation #72
Conversation
sonar/modules/users/ext.py
Outdated
@@ -0,0 +1,41 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you really need this extension?
}, | ||
"last_name": { | ||
"title": "Last name", | ||
"validationMessage": "Last Name is required.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validationMessage is not a json schema properties as I know. This should be in the form option. (Same for the entire file.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll remove these entries. For information, validationMessage entry exists in json schemas in RERO ILS, too : https://github.com/rero/rero-ils/search?p=1&q=validationMessage&unscoped_q=validationMessage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check with the rero-ils team? Thanks.
"type": "array", | ||
"uniqueItems": true, | ||
"minItems": 1, | ||
"maxItems": 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 or 4?
tests/ui/test_api.py
Outdated
}) | ||
|
||
record.reindex() | ||
record.reindex(True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing is really tested here except that the code does not produce error.
pid = PersistentIdentifier() | ||
last_name = SanitizedUnicode(required=True) | ||
first_name = SanitizedUnicode(required=True) | ||
email = SanitizedUnicode(required=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some other properties exists such as institution, etc. No?
tests/ui/test_api.py
Outdated
record.reindex() | ||
|
||
# Wait for indexing | ||
time.sleep(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can force to flush the index instead. Please check the rero-ils Patron indexer for example. Sleep is not safe.
* NEW Add user resource. * NEW Link institution to user resource. * NEW Link user account to user resource with account ID. * BETTER Remove "validationMessage" entries from json schemas. Signed-off-by: Sébastien Délèze <[email protected]>
Signed-off-by: Sébastien Délèze [email protected]