daily pastebin goal
93%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @login_required
  2. def add_board(request, context=None, template='add_board.html'):
  3.     context = context or {}
  4.     form = BoardForm(data=request.POST or None)
  5.     if request.POST:
  6.         if form.is_valid():
  7.             board = Board.objects.create(name=form.cleaned_data['name'])
  8.             board.user = request.user
  9.             return redirect(reverse('home'))
  10.  
  11.     context['form'] = form
  12.     return render(request, template, context)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top