Changeset 1167 in main


Ignore:
Timestamp:
06/04/12 15:15:24 (7 years ago)
Author:
pcosquer
Message:

pulication: fix broken (still untested) code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/controllers/plmobject.py

    r1162 r1167  
    614614        if (not res) and raise_: 
    615615            raise PermissionError("You are not allowed to publish an object") 
    616         res = res and self.check_in_group(raise_=raise_) 
     616        res = res and self.check_in_group(self._user, raise_=raise_) 
    617617        res = res and not self.published 
    618618        if (not res) and raise_: 
     
    652652        If *raise_* is True: 
    653653 
    654             :raise: :exc:`.PermissionError` if the user is not allowed to publish 
     654            :raise: :exc:`.PermissionError` if the user is not allowed to unpublish 
    655655                    an object (see :attr:`.UserProfile.can_publish`) 
    656656            :raise: :exc:`.PermissionError` if the user does not belong to 
    657657                    the object's group 
    658             :raise: :exc:`.ValueError` if the object is not published 
     658            :raise: :exc:`.ValueError` if the object is unpublished 
    659659 
    660660        If *raise_* is False: 
     
    664664        """ 
    665665 
    666         res = self._user.get_profile().can_unpublish 
     666        res = self._user.get_profile().can_publish 
    667667        if (not res) and raise_: 
    668668            raise PermissionError("You are not allowed to unpublish an object") 
     669        res = res and self.check_in_group(self._user, raise_=raise_) 
    669670        res = res and self.published 
    670671        if (not res) and raise_: 
     
    690691        self.check_unpublish() 
    691692        self.object.published = False 
    692         models.Publication.objects.filter(plmobject=self.object).delete() 
     693        self.object.save() 
    693694        details = u"Unpublished by %s (%s)" % (self._user.get_full_name(), self._user.username) 
    694695        self._save_histo("Unpublish", details) 
Note: See TracChangeset for help on using the changeset viewer.