Beispiel #1
0
   def dispatch(self, request, workgroup_slug, *args, **kwargs):   
       self.workgroup = get_object_or_404(WorkGroup, slug=workgroup_slug)         
       article = Article.get_for_object(Article.get_for_object(self.workgroup)) 
       
       self.sidebar_plugins = plugin_registry.get_sidebar()
       self.sidebar = []
 
       return super(WikiEdit, self).dispatch(request, article, *args, **kwargs)
Beispiel #2
0
    def dispatch(self, request, workgroup_slug, *args, **kwargs):
        self.workgroup = get_object_or_404(WorkGroup, slug=workgroup_slug)
        article = Article.get_for_object(self.workgroup)

        self.sidebar_plugins = plugin_registry.get_sidebar()
        self.sidebar = []

        return super(WikiEdit, self).dispatch(request, article, *args,
                                              **kwargs)
Beispiel #3
0
 def _create_test_image(self, path):
     # Get the form index
     plugin_index = -1
     for cnt, plugin_instance in enumerate(plugin_registry.get_sidebar()):
         if isinstance(plugin_instance, ImagePlugin):
             plugin_index = cnt
             break
     self.assertTrue(plugin_index >= 0, "Image plugin not activated")
     base_edit_url = reverse('wiki:edit', kwargs={'path': path})
     url = base_edit_url + '?f=form{0:d}'.format(plugin_index)
     filestream = self._create_gif_filestream_from_base64(self.test_data)
     response = self.c.post(
         url,
         {
             'unsaved_article_title': self.article.current_revision.title,
             'unsaved_article_content': self.article.current_revision.content,
             'image': filestream,
             'images_save': '1',
         },
     )
     self.assertRedirects(response, base_edit_url)
 def _create_test_image(self, path):
     # Get the form index
     plugin_index = -1
     for cnt, plugin_instance in enumerate(plugin_registry.get_sidebar()):
         if isinstance(plugin_instance, ImagePlugin):
             plugin_index = cnt
             break
     self.assertGreaterEqual(plugin_index, 0, msg="Image plugin not activated")
     base_edit_url = reverse("wiki:edit", kwargs={"path": path})
     url = base_edit_url + "?f=form{0:d}".format(plugin_index)
     filestream = self._create_gif_filestream_from_base64(self.test_data)
     response = self.client.post(
         url,
         {
             "unsaved_article_title": self.article.current_revision.title,
             "unsaved_article_content": self.article.current_revision.content,
             "image": filestream,
             "images_save": "1",
         },
     )
     self.assertRedirects(response, base_edit_url)
Beispiel #5
0
 def _create_test_image(self, path):
     # Get the form index
     plugin_index = -1
     for cnt, plugin_instance in enumerate(plugin_registry.get_sidebar()):
         if isinstance(plugin_instance, ImagePlugin):
             plugin_index = cnt
             break
     self.assertTrue(plugin_index >= 0, "Image plugin not activated")
     base_edit_url = reverse('wiki:edit', kwargs={'path': path})
     url = base_edit_url + '?f=form{0:d}'.format(plugin_index)
     filestream = self._create_gif_filestream_from_base64(self.test_data)
     response = self.c.post(
         url,
         {
             'unsaved_article_title': self.article.current_revision.title,
             'unsaved_article_content': self.article.current_revision.content,
             'image': filestream,
             'images_save': '1',
         },
     )
     self.assertRedirects(response, base_edit_url)
Beispiel #6
0
 def dispatch(self, request, article, *args, **kwargs):
     self.sidebar_plugins = plugin_registry.get_sidebar()
     self.sidebar = []
     return super().dispatch(request, article, *args, **kwargs)
Beispiel #7
0
 def dispatch(self, request, article, *args, **kwargs):
     self.sidebar_plugins = plugin_registry.get_sidebar()
     self.sidebar = []
     return super(Edit, self).dispatch(request, article, *args, **kwargs)
Beispiel #8
0
 def dispatch(self, request, article, *args, **kwargs):
     self.orig_content = kwargs.pop('content', None)
     self.sidebar_plugins = plugin_registry.get_sidebar()
     self.sidebar = []
     return super().dispatch(request, article, *args, **kwargs)