Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Добавил API для платёжных шлюзов (#15) #16

Merged
merged 23 commits into from Feb 22, 2022

Conversation

cofob
Copy link
Contributor

@cofob cofob commented Feb 20, 2022

Resolves #15

@cofob cofob added the enhancement New feature or request label Feb 20, 2022
@cofob cofob self-assigned this Feb 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2022

Codecov Report

Merging #16 (af6a771) into master (264e39d) will decrease coverage by 0.01%.
The diff coverage is 83.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   83.40%   83.38%   -0.02%     
==========================================
  Files          15       20       +5     
  Lines         223      295      +72     
  Branches       31       44      +13     
==========================================
+ Hits          186      246      +60     
- Misses         29       40      +11     
- Partials        8        9       +1     
Impacted Files Coverage Δ
autodonate/urls.py 90.90% <ø> (ø)
autodonate/lib/payment/models.py 78.84% <78.84%> (ø)
autodonate/lib/payment/api.py 80.00% <80.00%> (ø)
autodonate/lib/payment/currencies.py 100.00% <100.00%> (ø)
autodonate/lib/payment/urls.py 100.00% <100.00%> (ø)
...utodonate/migrations/0002_alter_payment_process.py 100.00% <100.00%> (ø)
autodonate/models.py 88.00% <100.00%> (+0.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 264e39d...af6a771. Read the comment docs.

Copy link
Contributor

@PerchunPak PerchunPak left a comment

Choose a reason for hiding this comment

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

Исправь для начала, пожалуйста, создание документации.

/autodonate/checkouts/16/autodonate/lib/payment/models.py:docstring of autodonate.lib.payment.models.PaymentService.pinging:1: WARNING: duplicate object description of autodonate.lib.payment.models.PaymentService.pinging, other instance in modules/autodonate.lib.payment.models, use :noindex: for one of them
/autodonate/checkouts/16/autodonate/lib/payment/models.py:docstring of autodonate.lib.payment.models.PaymentService.ping_interval:1: WARNING: duplicate object description of autodonate.lib.payment.models.PaymentService.ping_interval, other instance in modules/autodonate.lib.payment.models, use :noindex: for one of them
/autodonate/checkouts/16/autodonate/lib/payment/models.py:docstring of autodonate.lib.payment.models.PaymentService.logo_path:1: WARNING: duplicate object description of autodonate.lib.payment.models.PaymentService.logo_path, other instance in modules/autodonate.lib.payment.models, use :noindex: for one of them
/autodonate/checkouts/16/autodonate/lib/payment/models.py:docstring of autodonate.lib.payment.models.PaymentService.name:1: WARNING: duplicate object description of autodonate.lib.payment.models.PaymentService.name, other instance in modules/autodonate.lib.payment.models, use :noindex: for one of them

@cofob
Copy link
Contributor Author

cofob commented Feb 21, 2022

@PerchunPak проблема доков не моя проблема, что они пытаются 2 раза заиндексить одно и то же. Они собираются, что ещё не хватает?

Copy link
Contributor

@PerchunPak PerchunPak left a comment

Choose a reason for hiding this comment

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

Посмотрел на ошибки сборки документации, исправления почти не повлияют на код.

autodonate/lib/payment/models.py Outdated Show resolved Hide resolved
autodonate/lib/payment/models.py Show resolved Hide resolved
autodonate/lib/payment/models.py Outdated Show resolved Hide resolved
RUB = 0
UAH = 1
USD = 2
EUR = 3
Copy link
Contributor

Choose a reason for hiding this comment

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

Sphinx (модуль для генерации документации) автоматически документирует переменные объявленные таки образом.
image
Перепиши такие участки в стандартный __init__ метод. И не забывай документировать атрибуты!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Не понял что и куда переписать.

Copy link
Contributor

Choose a reason for hiding this comment

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

Запись атрибутов в __init__ метод.
Правильно:

class A:
    def __init__(self):
        self.a = "a"
        self.b = "b"

Как ты делаешь:

class A:
    a = "a"
    b = "b"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Документация с тобой не согласна. И может объяснишь почему это "неправильно"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Поставить флаг unique

Copy link
Contributor

Choose a reason for hiding this comment

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

Не решено, как я отметил в самом первом комментарие, это относиться и к другим 4 предупреждениям из за которых документация проваливается

Copy link
Contributor

Choose a reason for hiding this comment

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

И если отменить b799cdb это вернет ошибку, декоратор unique не помог.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

И если отменить b799cdb это вернет ошибку, декоратор unique не помог.

unique нужен для предотвращения ошибок в базе данных. Он и не должен был решить проблему с доками.

Copy link
Contributor

Choose a reason for hiding this comment

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

Тогда почему ты написал что решил?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Тогда почему ты написал что решил?

Потому что там был коммент с todo)

autodonate/lib/payment/models.py Outdated Show resolved Hide resolved
autodonate/models.py Outdated Show resolved Hide resolved
@cofob
Copy link
Contributor Author

cofob commented Feb 22, 2022

@PerchunPak удали те файлы на которые жалуется дока из индекса

@cofob
Copy link
Contributor Author

cofob commented Feb 22, 2022

И вообще это очень странно, откуда он там нашел modules/

autodonate/lib/payment/models.py Outdated Show resolved Hide resolved
autodonate/lib/payment/models.py Show resolved Hide resolved
@PerchunPak PerchunPak merged commit f213729 into master Feb 22, 2022
@cofob cofob deleted the feat/payments branch February 22, 2022 14:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
3 participants