Skip to content
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

[17.0] [MIG] base_api, openapi #1

Merged
merged 46 commits into from
Oct 16, 2024

Conversation

azimkhankuat
Copy link
Contributor

@azimkhankuat azimkhankuat commented Oct 14, 2024

[17.0] [MIG] base_api, openapi

Anvar Kildebekov and others added 30 commits October 14, 2024 09:12
💶 decreased due to creation of base_api
📖 description of error by skipping step about 'server_wide_modules'
🌈 refactoring due to creation of 'base_api' module

closes #64
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working

  if isinstance(v, collections.Mapping):
It should be

+             fields = [
+                 'company_id/id',
+                 'company_id/name'
+             ]

instead of
-             fields = [
-                        company_id,
-                        company_id/name
-                        ]
close #227

> Made via .github/workflows/DINAR-PORT.yml
close #403

> Made via .github/workflows/DINAR-PORT.yml
close #432

> Made via .github/workflows/DINAR-PORT.yml
also, add parameter `field` explicitly
previous commits history: https://github.com/itpp-labs/sync-addons/commits/13.0/openapi

> Made via .github/workflows/DINAR-PORT.yml
close #224

> Made via .github/workflows/DINAR-PORT.yml
> Made via .github/workflows/DINAR-PORT.yml
to fix this error:
```
ValueError: Field model_id of model openapi.access is defined as ondelete='restrict' while having ir.model as comodel, the 'restrict' mode
 is not supported for this type of field as comodel.
```
we don't need to use the internal mechanism of CORS handling because in
any way we have to use additional Nginx settings and it causes an error
like:
"The 'Access-Control-Allow-Origin' header contains multiple values"
 for a swagger, clarification is needed
 about which type of content the method consumes
@azimkhankuat azimkhankuat changed the title [17.0] [MIG] base_api [17.0] [MIG] base_api, openapi Oct 14, 2024
Copy link
Member

@em230418 em230418 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_logger.warning настораживает, как будто что-то неправильно работает, хотя на самом деле так ожидается. Поэтому вместо try except warning предлагаю переделать на обычные проверки.

Comment on lines 320 to 324
for k in ["form", "files"]:
try:
del log_data["request_data"][k]
except KeyError:
pass
except KeyError as e:
_logger.warning(f"KeyError encountered: {e}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переделай на if k in log_data["request_data"] с последующим уделалением. Warning делать не надо.

Comment on lines 113 to 117
except AttributeError:
pass
except AttributeError as e:
_logger.warning(f"AttributeError encountered: {e}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут предлагаю переделать на hasattr(data, "ids") и убрать warning

@em230418
Copy link
Member

Коммит который исправляет замечания выше надо объеденить с существующим коммитом precommit auto fixes.
это делается например через git rebase -i HEAD~3

@em230418 em230418 merged commit ac80b07 into it-projects-llc:17.0 Oct 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants