Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
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
Service Desk
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
Dominik Weitz
AKPlanning
Commits
14211003
Commit
14211003
authored
5 years ago
by
Benjamin Hättasch
Browse files
Options
Downloads
Patches
Plain Diff
Implement auto-population of event for AK creation
Add TODOs for other data manipulation/auto-creation/...-tasks
parent
c8921e8b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AKSubmission/forms.py
+1
-1
1 addition, 1 deletion
AKSubmission/forms.py
AKSubmission/views.py
+18
-1
18 additions, 1 deletion
AKSubmission/views.py
with
19 additions
and
2 deletions
AKSubmission/forms.py
+
1
−
1
View file @
14211003
...
@@ -19,7 +19,7 @@ class AKForm(forms.ModelForm):
...
@@ -19,7 +19,7 @@ class AKForm(forms.ModelForm):
'
conflicts
'
,
'
conflicts
'
,
'
prerequisites
'
,
'
prerequisites
'
,
'
notes
'
,
'
notes
'
,
'
event
'
]
]
widgets
=
{
widgets
=
{
'
requirements
'
:
forms
.
CheckboxSelectMultiple
,
'
requirements
'
:
forms
.
CheckboxSelectMultiple
,
...
...
This diff is collapsed.
Click to expand it.
AKSubmission/views.py
+
18
−
1
View file @
14211003
...
@@ -4,7 +4,7 @@ from django.urls import reverse_lazy
...
@@ -4,7 +4,7 @@ from django.urls import reverse_lazy
from
django.utils.translation
import
gettext_lazy
as
_
from
django.utils.translation
import
gettext_lazy
as
_
from
django.views.generic
import
ListView
,
DetailView
,
CreateView
from
django.views.generic
import
ListView
,
DetailView
,
CreateView
from
AKModel.models
import
AK
,
AKCategory
,
AKTag
from
AKModel.models
import
AK
,
AKCategory
,
AKTag
,
Event
from
AKModel.views
import
FilterByEventSlugMixin
from
AKModel.views
import
FilterByEventSlugMixin
from
AKSubmission.forms
import
AKForm
from
AKSubmission.forms
import
AKForm
...
@@ -70,3 +70,20 @@ class AKSubmissionView(CreateView):
...
@@ -70,3 +70,20 @@ class AKSubmissionView(CreateView):
def
get_success_url
(
self
):
def
get_success_url
(
self
):
messages
.
add_message
(
self
.
request
,
messages
.
SUCCESS
,
_
(
"
AK successfully created
"
))
messages
.
add_message
(
self
.
request
,
messages
.
SUCCESS
,
_
(
"
AK successfully created
"
))
return
reverse_lazy
(
'
submit:ak_detail
'
,
kwargs
=
{
'
event_slug
'
:
self
.
kwargs
[
'
event_slug
'
],
'
pk
'
:
self
.
object
.
pk
})
return
reverse_lazy
(
'
submit:ak_detail
'
,
kwargs
=
{
'
event_slug
'
:
self
.
kwargs
[
'
event_slug
'
],
'
pk
'
:
self
.
object
.
pk
})
def
form_valid
(
self
,
form
):
instance
=
form
.
save
(
commit
=
False
)
# Set event
instance
.
event
=
Event
.
get_by_slug
(
self
.
kwargs
[
"
event_slug
"
])
# Generate short name if not given
# TODO
# Generate wiki link
# TODO
# Generate slot(s)
# TODO
return
super
().
form_valid
(
form
)
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