Port is correctly placed in Bark URL if provided (#672)

This commit is contained in:
Chris Caron 2022-09-22 23:04:02 -04:00 committed by GitHub
parent 4b4e4ffd77
commit 370b1af5a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,14 +208,13 @@ class NotifyBark(NotifyBase):
super(NotifyBark, self).__init__(**kwargs)
# Prepare our URL
self.notify_url = '%s://%s/push' % (
self.notify_url = '%s://%s%s/push' % (
'https' if self.secure else 'http',
self.host,
':{}'.format(self.port)
if (self.port and isinstance(self.port, int)) else '',
)
if isinstance(self.port, int):
self.notify_url += ':%d' % self.port
# Assign our category
self.category = \
category if isinstance(category, six.string_types) else None