Skip to content

Commit 427e4e1

Browse files
author
renzon
committed
Removed payments app
close #2411
1 parent c982bb5 commit 427e4e1

36 files changed

+22
-731
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ codecov = "*"
3030
django-bootstrap4 = "*"
3131
celery = "*"
3232
redis = "*"
33-
django-pagarme = "*"
3433
inflection = "*"
3534
django-two-factor-auth = "*"
3635
django-recaptcha = "*"
36+
django-pagarme = "*"
3737

3838
[dev-packages]
3939
faker = "*"

Pipfile.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pythonpro/checkout/templates/checkout/membership_lp_subscription_closed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{% endblock %}
2727

2828
{% block body %}
29-
{% include 'payments/_whatsapp_widget.html' %}
29+
{% include 'launch/_whatsapp_widget.html' %}
3030
<header class="header-main">
3131
<div class="header-main__group text-center">
3232
<h1 class="header-main__group__title text-uppercase fw-800 font-highlighted">

pythonpro/checkout/templates/checkout/membership_lp_subscription_open.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{% endblock %}
2727

2828
{% block body %}
29-
{% include 'payments/_whatsapp_widget.html' %}
29+
{% include 'launch/_whatsapp_widget.html' %}
3030
<header class="header-main">
3131
<div class="header-main__group text-center">
3232
<h1 class="header-main__group__title text-uppercase fw-800 font-highlighted">Saiba como ter acesso a um mercado que paga altos salários e tem milhares de vagas em aberto!</h1>

pythonpro/core/tests/test_view_home.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def home_resp_open_subscriptions(settings, client):
6666
return _resp(client)
6767

6868

69+
@pytest.mark.skip # TODO: reimplement based on dates
6970
def test_payment_link_is_present(home_resp_open_subscriptions):
7071
"""
7172
Assert Payment link is present on home page when subscriptions are open

pythonpro/domain/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from pythonpro.domain import (checkout_domain, content_statistics_domain, membership_domain, user_facade)
1+
from pythonpro.domain import (checkout_domain, content_statistics_domain, user_facade)
22

33
__all__ = [
44
'content_statistics_domain',
5-
'membership_domain',
65
'user_facade',
76
'checkout_domain'
87
]

pythonpro/domain/membership_domain.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

pythonpro/domain/tests/test_pytools_promotion.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

pythonpro/domain/user_facade.py

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@
1010
from django.conf import settings, settings as _settings
1111
from django.core.mail import send_mail as _send_mail
1212
from django.template.loader import render_to_string
13-
from django.urls import reverse
1413

1514
from pythonpro.absolute_uri import build_absolute_uri
1615
from pythonpro.cohorts import facade as _cohorts_facade
1716
from pythonpro.core import facade as _core_facade
1817
from pythonpro.core.models import User as _User
1918
from pythonpro.discourse.facade import MissingDiscourseAPICredentials, generate_sso_payload_and_signature
2019
from pythonpro.email_marketing import facade as _email_marketing_facade
21-
from pythonpro.payments import facade as _payments_facade
2220

2321
_logger = Logger(__file__)
2422

2523
UserCreationException = _core_facade.UserCreationException # exposing exception on Facade
2624

2725
__all__ = [
28-
'register_lead', 'force_register_client', 'promote_client', 'activate_user', 'find_user_interactions',
26+
'register_lead', 'force_register_client', 'activate_user', 'find_user_interactions',
2927
'visit_member_landing_page', 'run_pytools_promotion_campaign', 'promote_member', 'find_user_by_email',
3028
'find_user_by_id', 'force_register_lead', 'subscribe_to_waiting_list', 'force_register_member',
3129
'click_member_checkout', 'subscribe_anonymous_user_to_waiting_list'
@@ -139,7 +137,7 @@ def promote_member(user: _User, source: str) -> _User:
139137
except _ActiveCampaignError:
140138
pass
141139
email_msg = render_to_string(
142-
'payments/membership_email.txt',
140+
'launch/membership_email.txt',
143141
{
144142
'user': user,
145143
'cohort_detail_url': build_absolute_uri(cohort.get_absolute_url())
@@ -212,40 +210,6 @@ def promote_data_scientist(user: _User, source: str) -> _User:
212210
return user
213211

214212

215-
def promote_client(user: _User, source: str) -> None:
216-
"""
217-
Promote a user to Client role and change it's role on Email Marketing. Will not fail in case API call fails.
218-
Email welcome email is sent to user
219-
:param source: source of traffic
220-
:param user:
221-
:return:
222-
"""
223-
_core_facade.promote_to_client(user, source)
224-
sync_user_on_discourse(user)
225-
try:
226-
_email_marketing_facade.create_or_update_client(user.first_name, user.email, id=user.id)
227-
except _ActiveCampaignError:
228-
pass
229-
email_msg = render_to_string(
230-
'payments/pytools_email.txt',
231-
{
232-
'user': user,
233-
'ty_url': build_absolute_uri(reverse('payments:pytools_thanks'))
234-
}
235-
)
236-
_send_mail(
237-
'Inscrição no curso Pytools realizada! Confira o link com detalhes.',
238-
email_msg,
239-
_settings.DEFAULT_FROM_EMAIL,
240-
[user.email]
241-
)
242-
243-
244-
def promote_client_and_remove_boleto_tag(user: _User, source: str = None):
245-
promote_client(user, source)
246-
_email_marketing_facade.remove_tags(user.email, user.id, CLIENT_BOLETO_TAG)
247-
248-
249213
def find_user_by_email(user_email: str) -> _User:
250214
"""
251215
Find user by her email

pythonpro/payments/templates/payments/_whatsapp_widget.html renamed to pythonpro/launch/templates/launch/_whatsapp_widget.html

File renamed without changes.

0 commit comments

Comments
 (0)