-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Log operations #6419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log operations #6419
Changes from 1 commit
c393d73
8309bac
3365d4f
e18af96
41af0c5
8ca4740
e39fbb5
d7677df
721948e
d92ba32
8b79b72
27bb832
2c0df27
801a901
32a91db
322181d
467ea74
b0d90be
84c6aa5
6ccfb02
d707ce8
c5c032d
9bd9902
ccc6354
e741e04
e723bd1
81f9024
9f0a770
6030a71
b82416d
8bed9d0
c192dce
89b0249
4e4d331
b57802c
3b4e002
4bf6ce9
153a60b
2c0a1c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
… intended
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,9 @@ | |
) | ||
from menus.menu_pool import menu_pool | ||
|
||
# FIXME: REMOVEME: | ||
from attrdict import AttrDict | ||
|
||
|
||
def get_permission_accessor(obj): | ||
User = get_user_model() | ||
|
@@ -136,6 +139,9 @@ class BasePageForm(forms.ModelForm): | |
help_text=_('A description of the page used by search engines.'), | ||
max_length=320) | ||
|
||
# FIXME: REMOVEME: Waiting for request to be passed through, temp hack for testing in the UI | ||
request = AttrDict({'user': {'pk': 1 }}) | ||
|
||
class Meta: | ||
model = Page | ||
fields = [] | ||
|
@@ -268,7 +274,6 @@ def save(self, *args, **kwargs): | |
|
||
operation_token = operation_helpers.send_pre_page_operation( | ||
request=self.request, | ||
sender=self.model, | ||
operation=ADD_PAGE_TRANSLATION, | ||
) | ||
|
||
|
@@ -308,9 +313,9 @@ def save(self, *args, **kwargs): | |
|
||
operation_helpers.send_post_page_operation( | ||
request=self.request, | ||
sender=self.model, | ||
operation=ADD_PAGE_TRANSLATION, | ||
token=operation_token, | ||
obj=new_page, | ||
) | ||
|
||
return new_page | ||
|
@@ -465,7 +470,6 @@ def save(self, commit=True): | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove newline |
||
operation_token = operation_helpers.send_pre_page_operation( | ||
request=self.request, | ||
sender=self.model, | ||
operation=CHANGE_PAGE_TRANSLATION | ||
) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this 8000 commentThe reason will be displayed to describe this comment to others. Learn more. remove newline |
||
|
@@ -496,9 +500,9 @@ def save(self, commit=True): | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove newline |
||
operation_helpers.send_post_page_operation( | ||
request=self.request, | ||
sender=self.model, | ||
operation=CHANGE_PAGE_TRANSLATION, | ||
token=operation_token | ||
token=operation_token, | ||
obj=cms_page, | ||
) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove newline |
||
return cms_page | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,23 @@ | |
from cms.signals import pre_obj_operation, post_obj_operation | ||
|
||
|
||
def send_pre_page_operation(request, sender, operation, obj=Page, **kwargs): | ||
def send_pre_page_operation(request, operation, sender=Page, **kwargs): | ||
token = str(uuid.uuid4()) | ||
pre_obj_operation.send( | ||
sender=sender, | ||
operation=operation, | ||
request=request, | ||
token=token, | ||
obj=obj, | ||
**kwargs | ||
) | ||
return token | ||
|
||
|
||
def send_post_page_operation(request, sender, operation, token, obj=Page, **kwargs): | ||
def send_post_page_operation(request, operation, token, sender=Page, **kwargs): | ||
post_obj_operation.send( | ||
sender=sender, | ||
operation=operation, | ||
request=request, | ||
token=token, | ||
obj=obj, | ||
**kwargs | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove newline