Permalink
Browse files

Issue #25

Make sure the get_current is not called when being read in imports.
  • Loading branch information...
1 parent 4f76f3a commit 2e112f17a34ad61e68e2ad183fd0554ddedabdbd @erlenddalen committed May 28, 2013
@@ -16,4 +16,4 @@ class MediaTreeGallery(MediaTreeImageListingBase):
class MediaTreeGalleryItem(MediaTreeImageItemBase):
list_plugin = models.ForeignKey(MediaTreeGallery, related_name='media_items')
- node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current()})
+ node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current})
@@ -9,12 +9,12 @@
class MediaTreeImageSiteManager(models.Manager):
def get_query_set(self):
- return super(MediaTreeImageSiteManager, self).get_query_set().filter(node__site=Site.objects.get_current())
+ return super(MediaTreeImageSiteManager, self).get_query_set().filter(node__site=Site.objects.get_current)
class MediaTreeImage(CMSPlugin):
node = FileNodeForeignKey(allowed_media_types=(media_types.SUPPORTED_IMAGE,), verbose_name=_('file'),
- limit_choices_to = {"site": Site.objects.get_current()})
+ limit_choices_to = {"site": Site.objects.get_current})
link_type = models.CharField(_('link type'), max_length=1, blank=True, null=True, default=plugins_settings.MEDIA_TREE_CMS_PLUGIN_LINK_TYPE_DEFAULT, choices=plugins_settings.MEDIA_TREE_CMS_PLUGIN_LINK_TYPE_CHOICES, help_text=_('Makes the image a clickable link.'))
link_page = models.ForeignKey(Page, verbose_name=_("page"), null=True, blank=True, help_text=_('For link to page. Select any page from the list.'))
link_url = models.CharField(_("web address"), max_length=255, blank=True, null=True, help_text=_('For link to web address. Example: Enter "http://www.domain.com" to create an absolute link to an external site, or enter a relative URL like "/about/contact".'))
@@ -52,4 +52,4 @@ class MediaTreeListing(MediaTreeListingBase):
class MediaTreeListingItem(MediaTreeListingItemBase):
list_plugin = models.ForeignKey(MediaTreeListing, related_name='media_items')
- node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current()})
+ node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current})
@@ -43,4 +43,4 @@ class Meta:
class MediaTreeSlideshowItem(MediaTreeImageItemBase):
list_plugin = models.ForeignKey(MediaTreeSlideshow, related_name='media_items')
- node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current()})
+ node = FileNodeForeignKey(verbose_name=_('folder/file'), limit_choices_to={"site": Site.objects.get_current})

0 comments on commit 2e112f1

Please sign in to comment.