Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group 25
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andre Matthew Dumandan
widget_group 25
Commits
79b2a22e
Commit
79b2a22e
authored
May 24, 2022
by
Andre Matthew Dumandan
😴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deleted unnecessary function in Homepage views.py
parent
c3d08467
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
views.py
widget_group_25/homepage/views.py
+2
-9
No files found.
widget_group_25/homepage/views.py
View file @
79b2a22e
from
django.shortcuts
import
render
,
redirect
from
django.shortcuts
import
render
,
redirect
from
django.template
import
loader
from
django.template
import
loader
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
WidgetUser
,
Department
from
.models
import
WidgetUser
from
django.views.generic.edit
import
CreateView
from
django.views.generic.edit
import
CreateView
from
django.views.generic
import
View
from
django.views.generic
import
View
...
@@ -26,11 +26,4 @@ class WidgetUserCreateView(CreateView):
...
@@ -26,11 +26,4 @@ class WidgetUserCreateView(CreateView):
def
form_valid
(
request
,
form
):
def
form_valid
(
request
,
form
):
if
form
.
is_valid
():
if
form
.
is_valid
():
new_user
=
form
.
save
()
new_user
=
form
.
save
()
return
redirect
(
"homepage:widgetuser_add"
)
return
redirect
(
"homepage:widgetuser_add"
)
\ No newline at end of file
#Uses the built-in context function to create a selection of department objects for the form
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
()
.
get_context_data
(
**
kwargs
)
context
[
"departments"
]
=
Department
.
objects
.
all
()
return
context
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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