Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
BDE
nk20
Commits
34949f08
Commit
34949f08
authored
4 years ago
by
ynerant
Browse files
Options
Downloads
Patches
Plain Diff
Fix activity in Guest model
parent
ceb56908
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!32
Activity management
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/activity/forms.py
+0
-7
0 additions, 7 deletions
apps/activity/forms.py
apps/activity/urls.py
+1
-1
1 addition, 1 deletion
apps/activity/urls.py
apps/activity/views.py
+7
-1
7 additions, 1 deletion
apps/activity/views.py
with
8 additions
and
9 deletions
apps/activity/forms.py
+
0
−
7
View file @
34949f08
...
...
@@ -29,13 +29,6 @@ class ActivityForm(forms.ModelForm):
class
GuestForm
(
forms
.
ModelForm
):
def
clean
(
self
,
**
kwargs
):
cleaned_data
=
super
().
clean
()
self
.
instance
.
activity
=
cleaned_data
[
"
activity
"
]
=
Activity
.
objects
.
get
(
pk
=
1
)
return
cleaned_data
class
Meta
:
model
=
Guest
fields
=
(
'
last_name
'
,
'
first_name
'
,
'
inviter
'
,
)
...
...
This diff is collapsed.
Click to expand it.
apps/activity/urls.py
+
1
−
1
View file @
34949f08
...
...
@@ -10,7 +10,7 @@ app_name = 'activity'
urlpatterns
=
[
path
(
''
,
views
.
ActivityListView
.
as_view
(),
name
=
'
activity_list
'
),
path
(
'
<int:pk>/
'
,
views
.
ActivityDetailView
.
as_view
(),
name
=
'
activity_detail
'
),
path
(
'
<int:
activity_
pk>/invite/
'
,
views
.
ActivityInviteView
.
as_view
(),
name
=
'
activity_invite
'
),
path
(
'
<int:pk>/invite/
'
,
views
.
ActivityInviteView
.
as_view
(),
name
=
'
activity_invite
'
),
path
(
'
<int:pk>/entry/
'
,
views
.
ActivityEntryView
.
as_view
(),
name
=
'
activity_entry
'
),
path
(
'
<int:pk>/update/
'
,
views
.
ActivityUpdateView
.
as_view
(),
name
=
'
activity_update
'
),
path
(
'
new/
'
,
views
.
ActivityCreateView
.
as_view
(),
name
=
'
activity_create
'
),
...
...
This diff is collapsed.
Click to expand it.
apps/activity/views.py
+
7
−
1
View file @
34949f08
...
...
@@ -43,9 +43,15 @@ class ActivityUpdateView(LoginRequiredMixin, UpdateView):
class
ActivityInviteView
(
LoginRequiredMixin
,
CreateView
):
model
=
Guest
form_class
=
GuestForm
success_url
=
reverse_lazy
(
'
activity:activity_list
'
)
template_name
=
"
activity/activity_invite.html
"
def
form_valid
(
self
,
form
):
form
.
instance
.
activity
=
Activity
.
objects
.
get
(
pk
=
self
.
kwargs
[
"
pk
"
])
return
super
().
form_valid
(
form
)
def
get_success_url
(
self
,
**
kwargs
):
return
reverse_lazy
(
'
activity:activity_detail
'
,
kwargs
=
{
"
pk
"
:
self
.
kwargs
[
"
pk
"
]})
class
ActivityEntryView
(
LoginRequiredMixin
,
TemplateView
):
pass
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