Skip to content

Commit

Permalink
Merge pull request #4727 from ichorid/fix_chan_status
Browse files Browse the repository at this point in the history
Fix personal channel status not changing on creation/edit/commit
  • Loading branch information
qstokkink authored Aug 1, 2019
2 parents 80ddf32 + fdcff77 commit 649ee97
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def update_metadata(self, update_dict=None):
channel_dict = self.to_dict()
channel_dict.update(update_dict or {})
channel_dict.update({'num_entries': self.contents_len})
channel_dict["status"] = UPDATED
self.set(**channel_dict)
self.sign()

Expand All @@ -137,7 +138,7 @@ def create_channel(cls, title, description=""):
raise DuplicateChannelIdError()

my_channel = cls(origin_id=0, public_key=database_blob(cls._my_key.pub().key_to_bin()[10:]),
title=title, tags=description, subscribed=True, share=True,
title=title, tags=description, subscribed=True, share=True, status=NEW,
infohash=str(random.getrandbits(160)))
# random infohash is necessary to avoid triggering DB uniqueness constraints
my_channel.sign()
Expand Down Expand Up @@ -246,6 +247,7 @@ def commit_channel_torrent(self, new_start_timestamp=None):

# Write the channel mdblob to disk
self.update_metadata(update_dict)
self.status = COMMITTED
self.to_file(os.path.join(self._channels_dir, self.dirname + BLOB_EXTENSION))

self._logger.info("Channel %s committed with %i new entries. New version is %i",
Expand Down

0 comments on commit 649ee97

Please sign in to comment.