Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
6116c5b3
Commit
6116c5b3
authored
Jul 19, 2021
by
Matheus Miranda
Browse files
Update forum on course update
parent
ccc177c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
courses/certification/signals.py
courses/certification/signals.py
+10
-1
No files found.
courses/certification/signals.py
View file @
6116c5b3
...
...
@@ -25,7 +25,16 @@ def course_created(sender, created, instance, **kwargs):
forum
=
Forum
.
objects
.
create
(
title
=
instance
.
name
,
is_public
=
True
,
forum_type
=
"course"
)
instance
.
forum
=
forum
instance
.
save
()
for
type_
in
CertificateTemplate
.
TYPES
:
ct
=
CertificateTemplate
(
course
=
instance
,
document_type
=
type_
[
0
])
ct
.
save
()
else
:
foruns
=
Forum
.
objects
.
filter
(
id
=
instance
.
forum
.
id
)
if
foruns
:
forum
=
foruns
.
first
()
forum
.
title_en
=
instance
.
name_en
forum
.
title_es
=
instance
.
name_es
forum
.
title_pt_br
=
instance
.
name_pt_br
forum
.
save
()
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