pages get unpublished on save by users who don't have publish permission #1642

Closed
stefanfoulis opened this Issue Feb 20, 2013 · 1 comment

Projects

None yet

2 participants

@stefanfoulis
Member

the form code at https://github.com/divio/django-cms/blob/develop/cms/admin/pageadmin.py#L328 will basically toggle the 'published' value in excludes on each request.

It should be more like this (there must be a simpler way to express this though):

if obj.has_publish_permission(request):
    if 'published' in self.exclude:
        self.exclude.remove('published')
else:
    if 'published' not in self.exclude:
        self.exclude.append('published')

BUT it would be cleaner to not use the exclude class attribute to save this state, because it is persistent between requests. Instead we should explicitly pass in the excluded fields to form = super(PageAdmin, self).get_form(request, obj, **kwargs).

@digi604
Member
digi604 commented Feb 10, 2014

this should not happen anymore and should be fixed with the language publish

@digi604 digi604 closed this Feb 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment