Skip to content

Commit

Permalink
Merge pull request #57 from seasidesparrow/update_issn_endpt.20231106
Browse files Browse the repository at this point in the history
Update issn endpt.20231106
  • Loading branch information
seasidesparrow committed Nov 6, 2023
2 parents 1c81367 + 1053e3b commit 2467d84
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions journalsservice/views.py
Expand Up @@ -176,15 +176,31 @@ def get(self, issn):
with current_app.session_scope() as session:
dat_idents = session.query(JournalsIdentifiers).filter(and_(JournalsIdentifiers.id_value==issn, JournalsIdentifiers.id_type.like("ISSN%"))).first()
if dat_idents:
pub_abbrev = None
masterid = dat_idents.masterid
id_value = dat_idents.id_value
id_type = dat_idents.id_type
dat_master = session.query(JournalsMaster).filter_by(masterid=masterid).first()
bibstem = dat_master.bibstem
journal_name = dat_master.journal_name
dat_titlehist = [rec.toJSON() for rec in session.query(JournalsTitleHistory).filter_by(masterid=masterid).all()]
if dat_titlehist:
dat_pubhist = []
for t in dat_titlehist:
publisherid = t.pop('publisherid', None)
if publisherid:
pub = session.query(JournalsPublisher).filter_by(publisherid=publisherid).first()
pubhist = {'publisher': pub.toJSON()['pubabbrev'], 'title': t}
dat_pubhist.append(pubhist)
for p in dat_pubhist:
if not p.get("title", {}).get("year_end", None):
if p.get("publisher", None):
pub_abbrev = p.get("publisher")

request_json = {'issn': {'ISSN': id_value,
'ISSN_type': id_type,
'bibstem': bibstem,
'publisher': pub_abbrev,
'journal_name': journal_name}}
except Exception as err:
return {'Error': 'issn search failed',
Expand Down

0 comments on commit 2467d84

Please sign in to comment.