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

Implement organizer onboarding process | Validate condition to public Event #429

Merged
merged 32 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
75a08f6
Implement billing settings form for organizer
odkhang Oct 31, 2024
b0d7932
Resolve conflict
odkhang Oct 31, 2024
9b499db
Fix flake8 in pipeline
odkhang Oct 31, 2024
a17173a
implement create and save payment_information
odkhang Oct 21, 2024
055b2d7
Fix isort, flake8 in pipeline
odkhang Oct 31, 2024
045bfe4
implement payment-information-v1
odkhang Oct 24, 2024
e7510d2
src/pretix/control/views/organizer_views/organizer_view.py
odkhang Oct 31, 2024
0c4b5f6
Code refactoring
odkhang Oct 28, 2024
f596f95
Code refactoring
odkhang Oct 28, 2024
ede87ff
Remove payment_information attribute
odkhang Oct 28, 2024
eb22165
Implement tax validation
odkhang Oct 30, 2024
8cf14e5
Update code
odkhang Oct 30, 2024
25f70a9
Update code
odkhang Oct 30, 2024
abc5731
Fix flake8 in pipeline
odkhang Oct 30, 2024
dbf24b2
Add pyvat package
odkhang Oct 30, 2024
7b1fe49
Fix flake8 in pipeline
odkhang Oct 31, 2024
27b71a6
Latest code
odkhang Oct 31, 2024
063d2a6
Fix flake8 in pipeline
odkhang Oct 31, 2024
c4b9ce5
Add logger error
odkhang Oct 31, 2024
7133019
Fix flake8 in pipeline
odkhang Oct 31, 2024
97fbc9c
Merge branch 'development' into feature-380
odkhang Nov 1, 2024
8b5f87e
Fix conflict pretix base migration
odkhang Nov 1, 2024
17064b1
Update pretix base migration
odkhang Nov 1, 2024
db4f7b2
Add logging information and modify error logging
odkhang Nov 4, 2024
5d5e638
Add comment,save tax_id, show error and sucess message
odkhang Nov 7, 2024
f440b63
Validate to public Event
lcduong Nov 11, 2024
7267829
Merge branch 'development' into feat-379-public-event-check
lcduong Nov 11, 2024
677296e
Merge branch 'development' into feat-379-public-event-check
lcduong Nov 18, 2024
5f8d2cb
Merge branch 'development' into feat-379-public-event-check
lcduong Nov 18, 2024
4eac140
fix UT
lcduong Nov 18, 2024
dd970ce
Merge branch 'development' into feat-379-public-event-check
odkhang Nov 18, 2024
21a2b92
Merge branch 'development' into feat-379-public-event-check
odkhang Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/pretix/base/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from pretix.helpers.thumb import get_thumbnail

from ..settings import settings_hierarkey
from .organizer import Organizer, Team
from .organizer import Organizer, OrganizerBillingModel, Team


class EventMixin:
Expand Down Expand Up @@ -1191,6 +1191,27 @@ def live_issues(self):
)
)

billing_obj = OrganizerBillingModel.objects.filter(organizer=self.organizer).first()

if not billing_obj or not billing_obj.stripe_payment_method_id:
issues.append(
(
"<a {a_attr}>"
+ gettext('You need to fill the billing information.')
+ "</a>"
).format(
a_attr='href="%s#tab-0-1-open"'
% (
reverse(
"control:organizer.settings.billing",
kwargs={
"organizer": self.organizer.slug,
},
),
),
)
)

responses = event_live_issues.send(self)
for receiver, response in sorted(responses, key=lambda r: str(r[0])):
if response:
Expand Down
21 changes: 21 additions & 0 deletions src/tests/api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from pretix.base.models import Device, Event, Organizer, Team, User
from pretix.base.models.devices import generate_api_token
from pretix.base.models.organizer import OrganizerBillingModel


@pytest.fixture
Expand All @@ -21,6 +22,26 @@ def organizer():
return Organizer.objects.create(name='Dummy', slug='dummy')


@pytest.fixture
@scopes_disabled()
def organizer_billing(organizer):
return OrganizerBillingModel.objects.create(
organizer=organizer,
primary_contact_name="John Doe",
primary_contact_email="[email protected]",
company_or_organization_name="Eventyay",
address_line_1="123 Main Street",
city="San Francisco",
zip_code="94105",
country="US",
preferred_language="en",
tax_id="123456789",
stripe_customer_id="cus_123456789",
stripe_payment_method_id="pm_123456789",
stripe_setup_intent_id="seti_123456789"
)


@pytest.fixture
@scopes_disabled()
def meta_prop(organizer):
Expand Down
2 changes: 1 addition & 1 deletion src/tests/api/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def test_event_update_live_no_payment_method(token_client, organizer, event, ite


@pytest.mark.django_db
def test_event_update_live_free_product(token_client, organizer, event, free_item, free_quota):
def test_event_update_live_free_product(token_client, organizer, event, free_item, free_quota, organizer_billing):
resp = token_client.patch(
'/api/v1/organizers/{}/events/{}/'.format(organizer.slug, event.slug),
{
Expand Down
16 changes: 16 additions & 0 deletions src/tests/control/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from tests.base import SoupTest, extract_form_fields

from pretix.base.models import Event, Order, Organizer, Team, User
from pretix.base.models.organizer import OrganizerBillingModel
from pretix.testutils.mock import mocker_context


Expand All @@ -20,6 +21,21 @@ def setUp(self):
self.user = User.objects.create_user('[email protected]', 'dummy')
self.orga1 = Organizer.objects.create(name='CCC', slug='ccc')
self.orga2 = Organizer.objects.create(name='MRM', slug='mrm')
self.orgabilling1 = OrganizerBillingModel.objects.create(
organizer=self.orga1,
primary_contact_name="John Doe",
primary_contact_email="[email protected]",
company_or_organization_name="Eventyay",
address_line_1="123 Main Street",
city="San Francisco",
zip_code="94105",
country="US",
preferred_language="en",
tax_id="123456789",
stripe_customer_id="cus_123456789",
stripe_payment_method_id="pm_123456789",
stripe_setup_intent_id="seti_123456789"
)
self.event1 = Event.objects.create(
organizer=self.orga1, name='30C3', slug='30c3',
date_from=datetime.datetime(2013, 12, 26, tzinfo=datetime.timezone.utc),
Expand Down
Loading