mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-16 01:42:11 -04:00
a
This commit is contained in:
@@ -5,7 +5,7 @@ from django import forms
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from .methods import get_next_state, is_mediacms_editor
|
from .methods import get_next_state, is_mediacms_editor
|
||||||
from .models import MEDIA_STATES, Category, Media, Subtitle
|
from .models import MEDIA_STATES, Category, Media, Subtitle, Tag
|
||||||
from .widgets import CategoryModalWidget
|
from .widgets import CategoryModalWidget
|
||||||
|
|
||||||
|
|
||||||
@@ -294,6 +294,10 @@ class MediaPublishForm(forms.ModelForm):
|
|||||||
|
|
||||||
media = super(MediaPublishForm, self).save(*args, **kwargs)
|
media = super(MediaPublishForm, self).save(*args, **kwargs)
|
||||||
|
|
||||||
|
for course in media.category.filter(is_lms_course=True):
|
||||||
|
tag, _ = Tag.objects.get_or_create(title=course.title[:100])
|
||||||
|
media.tags.add(tag)
|
||||||
|
|
||||||
return media
|
return media
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user