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

Создавать копию объекта params в UserRequestAbstract #244

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

leshchenko1979
Copy link
Owner

@leshchenko1979 leshchenko1979 commented Jul 23, 2024

Fixes #238

Summary by Sourcery

This pull request addresses a bug by ensuring that the 'params' object is copied in the 'UserRequestAbstract' class to prevent unintended modifications to the original object.

  • Bug Fixes:
    • Fixed an issue where the original 'params' object could be unintentionally modified by creating a copy of it in the 'UserRequestAbstract' class.

Copy link

sourcery-ai bot commented Jul 23, 2024

Reviewer's Guide by Sourcery

This pull request addresses issue #238 by modifying the UserRequestAbstract class in the fast_bitrix24/user_request.py file. The change ensures that the params object is copied during initialization, preventing any unintended side effects from external modifications to the original params object.

File-Level Changes

Files Changes
fast_bitrix24/user_request.py Modified the initialization of self.params to use a copy of the input params object to prevent unintended side effects from external modifications.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @leshchenko1979 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -52,7 +52,7 @@ def __init__(

# st_params будет использоваться для проверки параметров,
# но на сервер должны уходить параметры без изменения регистра
self.params = params
self.params = params.copy()
Copy link

Choose a reason for hiding this comment

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

issue: Consider handling the case where params is None.

If params can be None, calling params.copy() will raise an AttributeError. It might be safer to add a check or default to an empty dictionary.

@leshchenko1979 leshchenko1979 merged commit 8e1fb6f into master Jul 23, 2024
11 checks passed
@leshchenko1979 leshchenko1979 deleted the leshchenko1979/issue238 branch July 23, 2024 19:02
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.

Создавать копию объекта params в UserRequestAbstract
1 participant