SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
4ac0567f
Commit
4ac0567f
authored
6 years ago
by
Jorran de Wit
Browse files
Options
Downloads
Plain Diff
Merge branch 'commentmail' into development
parents
f214c6ff
8dc677ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
comments/utils.py
+13
-1
13 additions, 1 deletion
comments/utils.py
comments/views.py
+4
-4
4 additions, 4 deletions
comments/views.py
submissions/models.py
+2
-0
2 additions, 0 deletions
submissions/models.py
with
19 additions
and
5 deletions
comments/utils.py
+
13
−
1
View file @
4ac0567f
...
@@ -25,8 +25,20 @@ class CommentUtils(BaseMailUtil):
...
@@ -25,8 +25,20 @@ class CommentUtils(BaseMailUtil):
Requires loading:
Requires loading:
comment -- Comment
comment -- Comment
"""
"""
from
submissions.models
import
Submission
,
Report
comment
=
cls
.
_context
[
'
comment
'
]
send_mail
=
True
if
isinstance
(
comment
.
content_object
,
Submission
):
send_mail
=
comment
.
author
not
in
comment
.
content_object
.
authors
.
all
()
elif
isinstance
(
comment
.
content_object
,
Report
):
send_mail
=
comment
.
author
not
in
comment
.
content_object
.
submission
.
authors
.
all
()
if
not
send_mail
:
return
cls
.
_send_mail
(
cls
,
'
comment_vet_accepted
'
,
cls
.
_send_mail
(
cls
,
'
comment_vet_accepted
'
,
[
cls
.
_context
[
'
comment
'
]
.
author
.
user
.
email
],
[
comment
.
author
.
user
.
email
],
'
SciPost Comment published
'
)
'
SciPost Comment published
'
)
@classmethod
@classmethod
...
...
This diff is collapsed.
Click to expand it.
comments/views.py
+
4
−
4
View file @
4ac0567f
...
@@ -76,10 +76,6 @@ def vet_submitted_comment(request, comment_id):
...
@@ -76,10 +76,6 @@ def vet_submitted_comment(request, comment_id):
comment
.
vetted_by
=
request
.
user
.
contributor
comment
.
vetted_by
=
request
.
user
.
contributor
comment
.
save
()
comment
.
save
()
# Send emails
CommentUtils
.
load
({
'
comment
'
:
comment
})
CommentUtils
.
email_comment_vet_accepted_to_author
()
# Update `latest_activity` fields
# Update `latest_activity` fields
content_object
=
comment
.
content_object
content_object
=
comment
.
content_object
content_object
.
latest_activity
=
timezone
.
now
()
content_object
.
latest_activity
=
timezone
.
now
()
...
@@ -100,6 +96,10 @@ def vet_submitted_comment(request, comment_id):
...
@@ -100,6 +96,10 @@ def vet_submitted_comment(request, comment_id):
SubmissionUtils
.
load
({
'
submission
'
:
content_object
.
submission
})
SubmissionUtils
.
load
({
'
submission
'
:
content_object
.
submission
})
SubmissionUtils
.
send_author_comment_received_email
()
SubmissionUtils
.
send_author_comment_received_email
()
# Send emails
CommentUtils
.
load
({
'
comment
'
:
comment
})
CommentUtils
.
email_comment_vet_accepted_to_author
()
elif
form
.
cleaned_data
[
'
action_option
'
]
==
'
2
'
:
elif
form
.
cleaned_data
[
'
action_option
'
]
==
'
2
'
:
# The comment request is simply rejected
# The comment request is simply rejected
comment
.
status
=
int
(
form
.
cleaned_data
[
'
refusal_reason
'
])
comment
.
status
=
int
(
form
.
cleaned_data
[
'
refusal_reason
'
])
...
...
This diff is collapsed.
Click to expand it.
submissions/models.py
+
2
−
0
View file @
4ac0567f
...
@@ -70,6 +70,8 @@ class Submission(models.Model):
...
@@ -70,6 +70,8 @@ class Submission(models.Model):
default
=
CYCLE_DEFAULT
)
default
=
CYCLE_DEFAULT
)
fellows
=
models
.
ManyToManyField
(
'
colleges.Fellowship
'
,
blank
=
True
,
fellows
=
models
.
ManyToManyField
(
'
colleges.Fellowship
'
,
blank
=
True
,
related_name
=
'
pool
'
)
related_name
=
'
pool
'
)
# visible_pool = models.BooleanField(default=True)
# visible_public = models.BooleanField(default=False)
subject_area
=
models
.
CharField
(
max_length
=
10
,
choices
=
SCIPOST_SUBJECT_AREAS
,
subject_area
=
models
.
CharField
(
max_length
=
10
,
choices
=
SCIPOST_SUBJECT_AREAS
,
verbose_name
=
'
Primary subject area
'
,
default
=
'
Phys:QP
'
)
verbose_name
=
'
Primary subject area
'
,
default
=
'
Phys:QP
'
)
submission_type
=
models
.
CharField
(
max_length
=
10
,
choices
=
SUBMISSION_TYPE
)
submission_type
=
models
.
CharField
(
max_length
=
10
,
choices
=
SUBMISSION_TYPE
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment