Skip to content

Commit

Permalink
revert: changes in the cms user permission (#7043)
Browse files Browse the repository at this point in the history
fix: IntegrityError on some websites "'Cannot add or update a child row: a foreign key constraint fails "

Reverting the patch from this PR, since it is causing crash in some
websites with this error:

```python
django.db.utils.IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`test_museumday`.`cms_pageuser`, CONSTRAINT `cms_pageuser_created_by_id_8e9fbf83_fk_users_user_id` FOREIGN KEY (`created_by_id`) REFERENCES `users_user` (`id`))')
```

- https://django-cmsworkspace.slack.com/archives/C01J7H87KFC/p1621333264008900

Authored-by: Vinit Kumar <vinit.kumar@socialschools.nl>
Signed-off-by: Vinit Kumar <vinit.kumar@socialschools.nl>
  • Loading branch information
vinitkumar committed May 18, 2021
1 parent a8f2d9f commit ede0117
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cms/signals/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def post_save_user(instance, raw, created, **kwargs):
if not creator or not created or creator.is_anonymous:
return

page_user = PageUser(pk=instance.pk, created_by=creator)
page_user = PageUser(user_ptr_id=instance.pk, created_by=creator)
page_user.__dict__.update(instance.__dict__)
page_user.save()

Expand Down

0 comments on commit ede0117

Please sign in to comment.