diff --git a/debexpo/controllers/package.py b/debexpo/controllers/package.py index 550707fe73a331652aec6a24c3d0d43d5cbf65ea..111655d83e0a07c311d7cd25025bc94b1652b396 100644 --- a/debexpo/controllers/package.py +++ b/debexpo/controllers/package.py @@ -255,7 +255,7 @@ class PackageController(BaseController): session.save() redirect(url('login')) - self._get_package(packagename) + package = self._get_package(packagename) status = constants.PACKAGE_COMMENT_STATUS_NOT_UPLOADED @@ -281,10 +281,13 @@ class PackageController(BaseController): user = meta.session.query(User).filter_by(id=session['user_id']).one() if len(subscribers) > 0: - email = Email('comment_posted') email.send([s.user.email for s in subscribers], package=packagename, - comment=self.form_result['text'], user=user) + comment=self.form_result['text'], user=user, owner=False) + + email = Email('comment_posted') + email.send([package.user.email], package=packagename, + comment=self.form_result['text'], user=user, owner=True) meta.session.query(PackageVersion) \ .filter_by(id=self.form_result['package_version'])\ diff --git a/debexpo/templates/email/comment_posted.mako b/debexpo/templates/email/comment_posted.mako index 818084e336e20d09889f77c55bd73e5a7404e0cb..df4ee7c695797b887a95b98a3fc7bf0f809ea3e5 100644 --- a/debexpo/templates/email/comment_posted.mako +++ b/debexpo/templates/email/comment_posted.mako @@ -2,9 +2,11 @@ <%inherit file="/base.mako"/>To: ${ c.to } Subject: ${ _('Comment posted on %s' % c.package) } -${ _('''A comment has been posted on a package that you are subscribed to. +%if not c.owner: +${ _('A comment has been posted on a package that you are subscribed to.') } -%s made the following comment about the %s package:''' % (c.user.name, c.package)) } +%endif +${ _('''%s made the following comment about the %s package:''' % (c.user.name, c.package)) } ${ c.comment } @@ -12,6 +14,8 @@ ${ _('You can view information on the package by visiting:') } ${ c.config['debexpo.server'] }${ h.url('package', packagename=c.package) } +%if not c.owner: ${ _('You can change your subscription by visiting your user account settings.') } +%endif ${ _('Thanks,') } diff --git a/debexpo/templates/package/index.mako b/debexpo/templates/package/index.mako index 506f76de5150169d13d09187baf6e1e1fa39dc41..5b11aa3365883b800d8053876be707faaac3c17c 100644 --- a/debexpo/templates/package/index.mako +++ b/debexpo/templates/package/index.mako @@ -39,11 +39,13 @@ % if 'user_id' in c.session: +% if c.session['user_id'] != c.package.user_id: ${ _('Subscribe') }: ${ _('Edit your subscription') } +%endif ${ _('Needs a sponsor') }: