Skip to content

Commit

Permalink
See CHANGELOG tag-0.18-20210905e
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnavarro committed Sep 5, 2021
1 parent f647381 commit c91fdda
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
tag-0.18-20210905e JP
- Use defaults={} correctly in update_or_create

tag-0.18-20210905d JP
- Switch to .objects.update_or_create for Drupal 3.0

Expand Down
45 changes: 22 additions & 23 deletions bin/route_globus_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ def Update_REL(self, myURN, newRELATIONS):
relation, created = ResourceV3Relation.objects.update_or_create(
ID = relationID,
defaults={
FirstResourceID = myURN,
SecondResourceID = relatedID,
RelationType = relationType
'FirstResourceID': myURN,
'SecondResourceID': relatedID,
'RelationType': relationType
},
)
relation.save()
Expand Down Expand Up @@ -485,15 +485,14 @@ def Write_Globus_Collections(self, content, contype, config):
local, created = ResourceV3Local.objects.update_or_create(
ID = myGLOBALURN,
defaults={
CreationTime = datetime.now(timezone.utc),
Validity = self.DefaultValidity,
Affiliation = self.Affiliation,
LocalID = item['id'],
LocalType = config['LOCALTYPE'],
#LocalURL = item.get('DrupalUrl', config.get('SOURCEDEFAULTURL', None)),
LocalURL = "https://app.globus.org/file-manager?origin_id="+item['id'],
CatalogMetaURL = self.CATALOGURN_to_URL(config['CATALOGURN']),
EntityJSON = item.data
'CreationTime': datetime.now(timezone.utc),
'Validity': self.DefaultValidity,
'Affiliation': self.Affiliation,
'LocalID': item['id'],
'LocalType': config['LOCALTYPE'],
'LocalURL': "https://app.globus.org/file-manager?origin_id="+item['id'],
'CatalogMetaURL': self.CATALOGURN_to_URL(config['CATALOGURN']),
'EntityJSON': item.data
},
)
local.save()
Expand Down Expand Up @@ -541,17 +540,17 @@ def Write_Globus_Collections(self, content, contype, config):
resource, created = ResourceV3.objects.update_or_create(
ID = myGLOBALURN,
defaults={
Affiliation = self.Affiliation,
LocalID = item['id'],
QualityLevel = 'Production',
Name = resname,
ResourceGroup = myRESGROUP,
Type = myRESTYPE,
ShortDescription = item.get('description',resname),
ProviderID = None,
Description = Description.html(ID=myGLOBALURN),
Keywords = keywords,
Audience = self.Affiliation
'Affiliation': self.Affiliation,
'LocalID': item['id'],
'QualityLevel': 'Production',
'Name': resname,
'ResourceGroup': myRESGROUP,
'Type': myRESTYPE,
'ShortDescription': item.get('description',resname),
'ProviderID': None,
'Description': Description.html(ID=myGLOBALURN),
'Keywords': keywords,
'Audience': self.Affiliation
},
)
resource.save()
Expand Down

0 comments on commit c91fdda

Please sign in to comment.