Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

StaticGeneratorException on class-based generic views #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adonescunha
Copy link

AttributeError is being raised when quick_publish is called passing a path processed by a class-based generic view. The error occurs exactily in this line, using Django 1.3, in an attempt to lower case request.method which is not defined.

The solution was implemented using only one line of code in staticgenerator.StaticGenerator.get_content_from_path:

        request = self.http_request()
        request.method = 'GET' #<====
        request.path_info = path

Maybe a more elaborated solution is needed to avoid simliar issues, but this tiny modification solved my problems.

@andrewsmedina
Copy link

adding GET how reuqest.method isn't the way for fix this problem

IMHO, the best way is choose RequestFactory to create a request instance

I'm working on it, and too adding and refactoring several tests and removing useless FS layer in my fork

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants