Add copy_relations method on CMS plugin model
recommended by cms check
This commit is contained in:
parent
70ca66ebd5
commit
5f91637178
1 changed files with 6 additions and 1 deletions
|
|
@ -481,7 +481,6 @@ class GovernmentPlanSection(models.Model):
|
|||
|
||||
|
||||
if CMSPlugin:
|
||||
|
||||
PLUGIN_TEMPLATES = [
|
||||
("froide_govplan/plugins/default.html", _("Normal")),
|
||||
("froide_govplan/plugins/progress.html", _("Progress")),
|
||||
|
|
@ -594,6 +593,12 @@ if CMSPlugin:
|
|||
help_text=_("number of updates to skip from top of list"),
|
||||
)
|
||||
|
||||
def copy_relations(self, old_instance):
|
||||
"""
|
||||
Duplicate ManyToMany relations on plugin copy
|
||||
"""
|
||||
self.categories.set(old_instance.categories.all())
|
||||
|
||||
def get_updates(self, request, published_only=True):
|
||||
# TODO: remove duplication with GovernmentPlansCMSPlugin.get_plans
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue