Subversion Repositories SmartDukaan

Rev

Rev 16803 | Rev 16806 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16803 Rev 16805
Line 166... Line 166...
166
    def on_post(self, request, resp):
166
    def on_post(self, request, resp):
167
        try:
167
        try:
168
            filepath = "/tmp/rejectfile"
168
            filepath = "/tmp/rejectfile"
169
            with open(filepath,'w') as f:
169
            with open(filepath,'w') as f:
170
                f.write(request.stream.read())
170
                f.write(request.stream.read())
171
            ext = request.get_param("rejects")[1]
-
 
172
            if ext not in ['.xls','.xlsx']:
-
 
173
                raise falcon.HTTPError(falcon.HTTP_400, 'Invalid Extension use xls/xlsx', 'Invalid Extension use xls/xlsx')
-
 
-
 
171
 
174
            rejectCount = process_rejects(filepath) #this function is not yet implemented
172
            rejectCount = process_rejects(filepath) #this function is not yet implemented
175
            
173
            
176
            resp.body = """
174
            resp.body = """
177
                <html><head><title>Upload Rejects</title></head><body>
175
                <html><head><title>Upload Rejects</title></head><body>
178
            <h1>Reject Successful</h1>
176
            <h1>Reject Successful</h1>