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
9cc40e95
Commit
9cc40e95
authored
1 year ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
fix fellowships from nomination not being saved
parent
f1b893b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost_django/colleges/views.py
+5
-3
5 additions, 3 deletions
scipost_django/colleges/views.py
with
5 additions
and
3 deletions
scipost_django/colleges/views.py
+
5
−
3
View file @
9cc40e95
...
@@ -1053,6 +1053,7 @@ def _hx_fellowship_invitation_update_response(request, invitation_id):
...
@@ -1053,6 +1053,7 @@ def _hx_fellowship_invitation_update_response(request, invitation_id):
nonexpired_fellowship
=
(
nonexpired_fellowship
=
(
Fellowship
.
objects
.
exclude
(
Fellowship
.
objects
.
exclude
(
until_date__lte
=
timezone
.
now
().
date
(),
until_date__lte
=
timezone
.
now
().
date
(),
status
=
Fellowship
.
STATUS_GUEST
,
)
)
.
filter
(
.
filter
(
college
=
invitation
.
nomination
.
college
,
college
=
invitation
.
nomination
.
college
,
...
@@ -1065,7 +1066,7 @@ def _hx_fellowship_invitation_update_response(request, invitation_id):
...
@@ -1065,7 +1066,7 @@ def _hx_fellowship_invitation_update_response(request, invitation_id):
# Create a new Fellowship if no object exists
# Create a new Fellowship if no object exists
if
not
nonexpired_fellowship
:
if
not
nonexpired_fellowship
:
start_date
=
invitation
.
postpone_start_to
or
timezone
.
now
()
start_date
=
invitation
.
postpone_start_to
or
timezone
.
now
()
fellowship
=
Fellowship
.
objects
.
create
(
nonexpired_
fellowship
=
Fellowship
.
objects
.
create
(
college
=
invitation
.
nomination
.
college
,
college
=
invitation
.
nomination
.
college
,
contributor
=
invitation
.
nomination
.
profile
.
contributor
,
contributor
=
invitation
.
nomination
.
profile
.
contributor
,
start_date
=
start_date
,
start_date
=
start_date
,
...
@@ -1073,11 +1074,12 @@ def _hx_fellowship_invitation_update_response(request, invitation_id):
...
@@ -1073,11 +1074,12 @@ def _hx_fellowship_invitation_update_response(request, invitation_id):
)
)
invitation
.
nomination
.
add_event
(
invitation
.
nomination
.
add_event
(
description
=
f
"
Fellowship created (start:
{
fellowship
.
start_date
.
strftime
(
'
%Y-%m-%d
'
)
}
)
"
,
description
=
f
"
Fellowship created (start:
{
nonexpired_
fellowship
.
start_date
.
strftime
(
'
%Y-%m-%d
'
)
}
)
"
,
by
=
request
.
user
.
contributor
,
by
=
request
.
user
.
contributor
,
)
)
invitation
.
nomination
.
fellowship
=
fellowship
invitation
.
nomination
.
fellowship
=
nonexpired_fellowship
invitation
.
nomination
.
save
()
# else:
# else:
# # Update the start date of the Fellowship if an object already exists
# # Update the start date of the Fellowship if an object already exists
# nonexpired_fellowship.start_date = (
# nonexpired_fellowship.start_date = (
...
...
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