Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
0dc74eea
Verified
Commit
0dc74eea
authored
Aug 23, 2019
by
Baptiste Beauplat
Browse files
Notify uploader when a new comment is made on their package (Closes
#74
)
parent
8108654d
Changes
3
Hide whitespace changes
Inline
Side-by-side
debexpo/controllers/package.py
View file @
0dc74eea
...
@@ -255,7 +255,7 @@ class PackageController(BaseController):
...
@@ -255,7 +255,7 @@ class PackageController(BaseController):
session
.
save
()
session
.
save
()
redirect
(
url
(
'login'
))
redirect
(
url
(
'login'
))
self
.
_get_package
(
packagename
)
package
=
self
.
_get_package
(
packagename
)
status
=
constants
.
PACKAGE_COMMENT_STATUS_NOT_UPLOADED
status
=
constants
.
PACKAGE_COMMENT_STATUS_NOT_UPLOADED
...
@@ -281,10 +281,13 @@ class PackageController(BaseController):
...
@@ -281,10 +281,13 @@ class PackageController(BaseController):
user
=
meta
.
session
.
query
(
User
).
filter_by
(
id
=
session
[
'user_id'
]).
one
()
user
=
meta
.
session
.
query
(
User
).
filter_by
(
id
=
session
[
'user_id'
]).
one
()
if
len
(
subscribers
)
>
0
:
if
len
(
subscribers
)
>
0
:
email
=
Email
(
'comment_posted'
)
email
=
Email
(
'comment_posted'
)
email
.
send
([
s
.
user
.
email
for
s
in
subscribers
],
package
=
packagename
,
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
)
\
meta
.
session
.
query
(
PackageVersion
)
\
.
filter_by
(
id
=
self
.
form_result
[
'package_version'
])
\
.
filter_by
(
id
=
self
.
form_result
[
'package_version'
])
\
...
...
debexpo/templates/email/comment_posted.mako
View file @
0dc74eea
...
@@ -2,9 +2,11 @@
...
@@ -2,9 +2,11 @@
<%inherit file="/base.mako"/>To: ${ c.to }
<%inherit file="/base.mako"/>To: ${ c.to }
Subject: ${ _('Comment posted on %s' % c.package) }
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 }
${ c.comment }
...
@@ -12,6 +14,8 @@ ${ _('You can view information on the package by visiting:') }
...
@@ -12,6 +14,8 @@ ${ _('You can view information on the package by visiting:') }
${ c.config['debexpo.server'] }${ h.url('package', packagename=c.package) }
${ 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.') }
${ _('You can change your subscription by visiting your user account settings.') }
%endif
${ _('Thanks,') }
${ _('Thanks,') }
debexpo/templates/package/index.mako
View file @
0dc74eea
...
@@ -39,11 +39,13 @@
...
@@ -39,11 +39,13 @@
% if 'user_id' in c.session:
% if 'user_id' in c.session:
% if c.session['user_id'] != c.package.user_id:
<tr>
<tr>
<th>${ _('Subscribe') }:</th>
<th>${ _('Subscribe') }:</th>
<td><a href="${h.url('subscribe', packagename=c.package.name)}">${ _('Edit your subscription') }</a></td>
<td><a href="${h.url('subscribe', packagename=c.package.name)}">${ _('Edit your subscription') }</a></td>
</tr>
</tr>
%endif
<tr>
<tr>
<th>${ _('Needs a sponsor') }:</th>
<th>${ _('Needs a sponsor') }:</th>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment