-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kls 1815 product market fixes (#2875)
* KLS-1815: product market feature tweaks --------- Co-authored-by: boxadesign <[email protected]>
- Loading branch information
1 parent
eb262e9
commit 28b78cd
Showing
4 changed files
with
52 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -604,18 +604,34 @@ def get_context_data(self): | |
def post(self, request, *args, **kwargs): | ||
product = request.POST.get('product-input') | ||
market = request.POST.get('market-input') | ||
no_market = request.GET.get('no_market') | ||
action = actions.SaveOnlyInDatabaseAction( | ||
full_name='Anonymous user', | ||
subject='Product and Market experiment', | ||
email_address='[email protected]', | ||
form_url=self.request.get_full_path(), | ||
) | ||
|
||
if product and not market: | ||
return redirect(reverse_lazy('core:product-market') + '?product=' + product) | ||
if market: | ||
|
||
if no_market: | ||
data = { | ||
'product': request.POST.get('product'), | ||
'market': None, | ||
'userid': self.request.user.hashed_uuid if self.request.user.is_authenticated else None, | ||
} | ||
response = action.save(data) | ||
response.raise_for_status() | ||
|
||
return redirect('/markets') | ||
elif market: | ||
product = request.POST.get('product') | ||
data = {'product': product, 'market': market, 'userid': self.request.user.id} | ||
action = actions.SaveOnlyInDatabaseAction( | ||
full_name='Anonymous user', | ||
subject='Product and Market experiment', | ||
email_address='[email protected]', | ||
form_url=self.request.get_full_path(), | ||
) | ||
data = { | ||
'product': product, | ||
'market': market, | ||
'userid': self.request.user.hashed_uuid if self.request.user.is_authenticated else None, | ||
} | ||
response = action.save(data) | ||
response.raise_for_status() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters