Hey Sergei, whether or not this makes it into Mezzanine you could add this
functionality with monkey patching (rather than modifying Mezzanine
directly which would make upgrading Mezzanine in the future difficult).
Check out the Monkey Patching section of this blog post,
http://bitofpixels.com/blog/techniques-for-modifying-mezzanine/.  It goes
over modifying the get_absolute_url of Page, but you could abstract it to
modify the save method of comment or whatever.


On Thu, Jan 2, 2014 at 12:13 AM, Sergei G <[email protected]> wrote:

> I think it would be beneficial to set the default status of new comment to
> default settings value *only* if is_public is not set already.
>
> For example, if import operation sets the is_public value to 0, then it
> should not be overridden.
>
> Here is my proposed enhancement to generic/models.py file. I added line:
>
>             if self.is_public is None:
>
> to function:
>
>     def save(self, *args, **kwargs):
>         """
>         Set the current site ID, and ``is_public`` based on the setting
>         ``COMMENTS_DEFAULT_APPROVED``.
>         """
>         if not self.id:
>             if self.is_public is None:
>                 self.is_public = settings.COMMENTS_DEFAULT_APPROVED
>             self.site_id = current_site_id()
>         super(ThreadedComment, self).save(*args, **kwargs)
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to