Exemplo n.º 1
0
def upload(request):
    artist = request.user.artist
    
    if request.method == 'POST':
        form = UploadListing(request.POST, request=request)
        if form.is_valid():
            listing = form.save(artist, request.POST)
            messages.add_message(request, messages.INFO,
                    "You have successfully created %s. Your listing is currently in under review. This may take up to a couple of hours." % listing.title)
            return HttpResponseRedirect(reverse('all_listing'))

    else:
        form = UploadListing()
    return render(request, 'artists/upload.html', {'artist': artist, "form": form})
Exemplo n.º 2
0
def upload(request):
    artist = request.user.artist

    if request.method == 'POST':
        fee = get_fee(artist)
        form = UploadListing(request.POST, request=request)
        if form.is_valid():
            listing = form.save(artist, request.POST)
            messages.add_message(request, messages.INFO,
                _("Your listing %s has been successfully created and submitted for review. Your listing will go live within the next couple of hours.") % listing.title)
            return HttpResponseRedirect(reverse('all_listing'))

    else:
        form = UploadListing()
        fee = get_fee(artist)

    return render(request, 'artists/upload.html', {'artist': artist, "form": form, "fee": fee})
Exemplo n.º 3
0
def upload(request):
    artist = request.user.artist

    if request.method == 'POST':
        fee = get_fee(artist)
        form = UploadListing(request.POST, request=request)
        if form.is_valid():
            listing = form.save(artist, request.POST)
            messages.add_message(
                request, messages.INFO,
                _("Your listing %s has been successfully created and submitted for review. Your listing will go live within the next couple of hours."
                  ) % listing.title)
            return HttpResponseRedirect(reverse('all_listing'))

    else:
        form = UploadListing()
        fee = get_fee(artist)

    return render(request, 'artists/upload.html', {
        'artist': artist,
        "form": form,
        "fee": fee
    })