8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 12:53:11 +00:00

Rename vars

This commit is contained in:
chirac 2020-12-30 18:49:52 +01:00 committed by Gabriel Detraz
parent b12fc190ba
commit 1f83a8eff2
2 changed files with 12 additions and 12 deletions

View file

@ -114,28 +114,28 @@ def classes_for_action_type(action_type):
class ActionsSearchForm(Form):
"""Form used to do an advanced search through the logs."""
u = forms.ModelChoiceField(
user = forms.ModelChoiceField(
label=_("Performed by"),
queryset=users.models.User.objects.all(),
required=False,
)
t = forms.MultipleChoiceField(
action_type = forms.MultipleChoiceField(
label=_("Action type"),
required=False,
widget=forms.CheckboxSelectMultiple,
choices=CHOICES_ACTION_TYPE,
initial=[i[0] for i in CHOICES_ACTION_TYPE],
)
s = forms.DateField(required=False, label=_("Start date"))
e = forms.DateField(required=False, label=_("End date"))
start_date = forms.DateField(required=False, label=_("Start date"))
end_date = forms.DateField(required=False, label=_("End date"))
def __init__(self, *args, **kwargs):
super(ActionsSearchForm, self).__init__(*args, **kwargs)
self.fields["s"].help_text = get_input_formats_help_text(
self.fields["s"].input_formats
self.fields["start_date"].help_text = get_input_formats_help_text(
self.fields["start_date"].input_formats
)
self.fields["e"].help_text = get_input_formats_help_text(
self.fields["e"].input_formats
self.fields["end_date"].help_text = get_input_formats_help_text(
self.fields["end_date"].input_formats
)

View file

@ -600,10 +600,10 @@ class ActionsSearch:
Returns:
The QuerySet of Revision objects corresponding to the search.
"""
user = params.get("u", None)
start = params.get("s", None)
end = params.get("e", None)
action_types = params.get("t", None)
user = params.get("user", None)
start = params.get("start_date", None)
end = params.get("end_date", None)
action_types = params.get("action_type", None)
query = Q()