-
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
swisscovery: remove << and >> characters in the title when importing #781
swisscovery: remove << and >> characters in the title when importing #781
Conversation
267c5bd
to
b37ab86
Compare
a5299cd
to
57c552d
Compare
sonar/modules/swisscovery/rest.py
Outdated
@@ -66,8 +68,18 @@ def get_record(): | |||
|
|||
record = SRUSchema().dump(record) | |||
|
|||
# Remove << and >> in the title value | |||
pattern = re.compile('<<(.+)>>', re.S) | |||
if 'title' in record: |
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 write something like:
for title in record.get('title',[]):
for mainTitle in title.get('mainTitle', []):
....
def test_title_remove_char(client, submitter): | ||
"""Test for the removal of << and >> characters in the title.""" | ||
login_user_via_session(client, email=submitter['email']) | ||
res = client.get(url_for('swisscovery.get_record',query='2070406237')) |
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.
space is missing
be49f15
to
ac87eb4
Compare
sonar/modules/swisscovery/rest.py
Outdated
@@ -66,8 +68,15 @@ def get_record(): | |||
|
|||
record = SRUSchema().dump(record) | |||
|
|||
# Remove << and >> in the title value |
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.
The command or function is not correct. The regexp removes all << ??? >>>
!
* Closes rero#701. Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
ac87eb4
to
7cc382a
Compare
<<
and>>
characters should be removed from the title #701.Co-Authored-by: Bertrand Zuchuat bertrand.zuchuat@rero.ch
How to test?
Code review check list