Skip to content

Commit

Permalink
Small fix in translated pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JrooTJunior committed Oct 17, 2022
1 parent 6e31f93 commit 01028f1
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 31 deletions.
2 changes: 1 addition & 1 deletion aiogram/webhook/aiohttp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def ip_filter_middleware(
async def _ip_filter_middleware(request: web.Request, handler: Handler) -> Any:
ip_address, accept = check_ip(ip_filter=ip_filter, request=request)
if not accept:
loggers.webhook.warning(f"Blocking request from an unauthorized IP: {ip_address}")
loggers.webhook.warning("Blocking request from an unauthorized IP: %s", ip_address)
raise web.HTTPUnauthorized()
return await handler(request)

Expand Down
4 changes: 3 additions & 1 deletion docs/dispatcher/filters/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ For example if you need to make simple text filter:
Combining Filters
=================

.. versionadded:: 3.0b6

In general, all filters can be combined in two ways


Expand All @@ -72,7 +74,7 @@ If you specify multiple filters in a row, it will be checked with an "and" condi
@<router>.message(Text(startswith="show"), Text(endswith="example"))
Also, if you want to use two alternative ways to run the sage handler ("or" condition)
Also, if you want to use two alternative ways to run the same handler ("or" condition)
you can register the handler twice or more times as you like

.. code-block:: python
Expand Down
28 changes: 18 additions & 10 deletions docs/locale/en/LC_MESSAGES/dispatcher/filters/index.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: aiogram \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-03 01:03+0300\n"
"POT-Creation-Date: 2022-10-18 01:50+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -127,44 +127,52 @@ msgstr ""
msgid "For example if you need to make simple text filter:"
msgstr ""

#: ../../dispatcher/filters/index.rst:58
#: ../../dispatcher/filters/index.rst:60
msgid "Combining Filters"
msgstr ""

#: ../../dispatcher/filters/index.rst:60
#: ../../dispatcher/filters/index.rst:62
msgid "In general, all filters can be combined in two ways"
msgstr ""

#: ../../dispatcher/filters/index.rst:64
#: ../../dispatcher/filters/index.rst:66
msgid "Recommended way"
msgstr ""

#: ../../dispatcher/filters/index.rst:66
#: ../../dispatcher/filters/index.rst:68
msgid ""
"If you specify multiple filters in a row, it will be checked with an "
"\"and\" condition:"
msgstr ""

#: ../../dispatcher/filters/index.rst:73
#: ../../dispatcher/filters/index.rst:75
msgid ""
"Also, if you want to use two alternative ways to run the sage handler "
"Also, if you want to use two alternative ways to run the same handler "
"(\"or\" condition) you can register the handler twice or more times as "
"you like"
msgstr ""

#: ../../dispatcher/filters/index.rst:82
#: ../../dispatcher/filters/index.rst:84
msgid ""
"Also sometimes you will need to invert the filter result, for example you"
" have an *IsAdmin* filter and you want to check if the user is not an "
"admin"
msgstr ""

#: ../../dispatcher/filters/index.rst:91
#: ../../dispatcher/filters/index.rst:93
msgid "Another possible way"
msgstr ""

#: ../../dispatcher/filters/index.rst:93
#: ../../dispatcher/filters/index.rst:95
msgid ""
"An alternative way is to combine using special functions (:func:`and_f`, "
":func:`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):"
msgstr ""

#~ msgid ""
#~ "Also, if you want to use two "
#~ "alternative ways to run the sage "
#~ "handler (\"or\" condition) you can "
#~ "register the handler twice or more "
#~ "times as you like"
#~ msgstr ""
28 changes: 18 additions & 10 deletions docs/locale/uk_UA/LC_MESSAGES/dispatcher/filters/index.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: aiogram \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-03 01:03+0300\n"
"POT-Creation-Date: 2022-10-18 01:50+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -127,44 +127,52 @@ msgstr ""
msgid "For example if you need to make simple text filter:"
msgstr ""

#: ../../dispatcher/filters/index.rst:58
#: ../../dispatcher/filters/index.rst:60
msgid "Combining Filters"
msgstr ""

#: ../../dispatcher/filters/index.rst:60
#: ../../dispatcher/filters/index.rst:62
msgid "In general, all filters can be combined in two ways"
msgstr ""

#: ../../dispatcher/filters/index.rst:64
#: ../../dispatcher/filters/index.rst:66
msgid "Recommended way"
msgstr ""

#: ../../dispatcher/filters/index.rst:66
#: ../../dispatcher/filters/index.rst:68
msgid ""
"If you specify multiple filters in a row, it will be checked with an "
"\"and\" condition:"
msgstr ""

#: ../../dispatcher/filters/index.rst:73
#: ../../dispatcher/filters/index.rst:75
msgid ""
"Also, if you want to use two alternative ways to run the sage handler "
"Also, if you want to use two alternative ways to run the same handler "
"(\"or\" condition) you can register the handler twice or more times as "
"you like"
msgstr ""

#: ../../dispatcher/filters/index.rst:82
#: ../../dispatcher/filters/index.rst:84
msgid ""
"Also sometimes you will need to invert the filter result, for example you"
" have an *IsAdmin* filter and you want to check if the user is not an "
"admin"
msgstr ""

#: ../../dispatcher/filters/index.rst:91
#: ../../dispatcher/filters/index.rst:93
msgid "Another possible way"
msgstr ""

#: ../../dispatcher/filters/index.rst:93
#: ../../dispatcher/filters/index.rst:95
msgid ""
"An alternative way is to combine using special functions (:func:`and_f`, "
":func:`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):"
msgstr ""

#~ msgid ""
#~ "Also, if you want to use two "
#~ "alternative ways to run the sage "
#~ "handler (\"or\" condition) you can "
#~ "register the handler twice or more "
#~ "times as you like"
#~ msgstr ""
15 changes: 8 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ furo==2022.9.29 ; python_version >= "3.8" and python_version < "4.0"
idna==3.4 ; python_version >= "3.8" and python_version < "4.0"
imagesize==1.4.1 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==5.0.0 ; python_version >= "3.8" and python_version < "3.10"
incremental==21.3.0 ; python_version >= "3.8" and python_version < "4.0"
incremental==22.10.0 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "4.0"
livereload==2.6.3 ; python_version >= "3.8" and python_version < "4.0"
magic-filter==1.0.9 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -46,7 +46,7 @@ sphinx-copybutton==0.5.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx-intl==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
sphinx-prompt==1.5.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx-substitution-extensions==2022.2.16 ; python_version >= "3.8" and python_version < "4.0"
sphinx==5.2.3 ; python_version >= "3.8" and python_version < "4.0"
sphinx==5.3.0 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-applehelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-htmlhelp==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
Expand Down
1 change: 1 addition & 0 deletions tests/test_webhook/test_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_default(self):
assert len(ip_filter._allowed_ips) == 5116
assert "91.108.4.50" in ip_filter
assert "149.154.160.20" in ip_filter
assert "91.108.6.79" in ip_filter

@pytest.mark.parametrize(
"ip,ip_range",
Expand Down

0 comments on commit 01028f1

Please sign in to comment.