masonite 'Post' object has no attribute 'controller'

195 Views Asked by At

I have a controller in my Masonite project and I can't figure out why it is throwing this error. Here is my code snippet:

def restore(self, view: View, upload: Upload):
    upload.accept_file_types = None
    filename = upload.store(self.request.input('dump'))
    site = Site.find(self.request.input('site_id'))

    site.server.connect().put(
        static('disk', 'uploads/') + filename,
        '/dumps/postgres/'+filename
    )

    return 'uploaded?' + 
1

There are 1 best solutions below

0
On

This usually happens if there is some kind of typo in your application. It is a little ambiguous and doesn't point to a specific example but if you notice at the last line you have a + sign which is a syntax error. Removing that will fix the issue.