[Fixed]-'NoneType' object has no attribute 'strip'-extract image from posted url

1👍

In views.py do like:

def form_valid(self, form):
    self.object = form.save(commit=False)
    # any manual settings go here
    self.object.moderator = self.request.user
    url = self.request.GET.get('url', False)
    if url:
        image = extract(url)
    self.object.save()
    return HttpResponseRedirect(reverse('post', args=[self.object.slug]))

Leave a comment