Skip to content

Commit

Permalink
bugfix: added ver metadata to all newly created or upgraded items
Browse files Browse the repository at this point in the history
  • Loading branch information
pedohorse committed Apr 9, 2020
1 parent a20f7bd commit 584825f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python2.7libs/hpaste/hcollections/githubcollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def updateItemIfNeeded(self, item):
item._name = newname
item._meta['raw_url'] = gist['files'][newfilename]['raw_url']
item._meta['nettype'] = nettype
item._meta['ver'] = list(currentVersion)
item._id = '%s@%s' % (gist['id'], newfilename)
item._access = CollectionItem.AccessType.public if gist['public'] else CollectionItem.AccessType.private
item._readonly = False
Expand Down Expand Up @@ -503,6 +504,8 @@ def addItem(self,desiredName,description,content, access=CollectionItem.AccessTy
newname = newfilename.split(':',1)[1]

if metadata is None: metadata={}
if 'ver' not in metadata:
metadata['ver'] = list(currentVersion)
metadata['raw_url'] = gist['files'][newfilename]['raw_url']
desc = gist['description']
nettype = ''
Expand Down

0 comments on commit 584825f

Please sign in to comment.