Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CustomUser(AbstractBaseUser):
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['name', 'phone']


def has_perm(self, perm, obj=None):

return True
Expand Down
8 changes: 6 additions & 2 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def signup(request):
business = Business(user=user)
business.save()

# Create Plan
plan = Plan(name="testplan", description="test_description",duration_days=10,price=500.00,max_staff=10,max_branch=4)
plan.save()
# create BusinessTeamMember
business_team = BusinessTeamMember.objects.get_or_create(
business=business, user=user)
Expand All @@ -69,13 +72,14 @@ def signup(request):
ends_time = timezone.now() + timedelta(days=14)

subscription = Subscription.objects.get_or_create(
plan_id=1,
plan=plan,
business=business,
start_time=timezone.now(),
ends_time=ends_time,
is_active=True,
)

# import pdb
# pdb.set_trace()
# send confirmation email
token = account_activation_token.make_token(user)
user_id = urlsafe_base64_encode(force_bytes(user.id))
Expand Down