Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@property
def usage_url(self):
return reverse('wagtailmedia:media_usage',
args=(self.id,))
def is_editable_by_user(self, user):
from wagtailmedia.permissions import permission_policy
return permission_policy.user_has_permission_for_instance(user, 'change', self)
class Meta:
abstract = True
verbose_name = _('media')
class Media(AbstractMedia):
admin_form_fields = (
'title',
'file',
'collection',
'duration',
'width',
'height',
'thumbnail',
'tags',
)
def get_media_model():
from django.conf import settings
from django.apps import apps
ERROR,
"Failed to record content",
{
"foreign_page_id": foreign_id,
"exception": e,
"function": function.__name__,
})
return page
class PreventDeleteMixin(object):
hide_delete_button = True
class MoloMedia(AbstractMedia):
youtube_link = models.CharField(max_length=512, null=True, blank=True)
feature_in_homepage = models.BooleanField(default=False)
admin_form_fields = (
'title',
'file',
'collection',
'duration',
'width',
'height',
'thumbnail',
'tags',
'youtube_link',
'feature_in_homepage',
)