Skip to content

Instantly share code, notes, and snippets.

@PantherHawk
Created April 24, 2019 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PantherHawk/d77469be108d469a1f489e1429f0ba7e to your computer and use it in GitHub Desktop.
Save PantherHawk/d77469be108d469a1f489e1429f0ba7e to your computer and use it in GitHub Desktop.
class UserHome(UserPagesMixin, ListView):
...
def post(self, request, *args, **kwargs):
print('----------we are in post------------')
if 'eshel' in request.POST:
if 'yes_eshel' in request.POST:
print("YES ESHEL")
instance = Settings.objects.get(pk=self.request.user)
instance.eshel_member = True
instance.save()
if 'no_eshel' in request.POST:
print("NO ESHEL")
instance = Settings.objects.get(pk=self.request.user)
instance.eshel_member = False
instance.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment