public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM1397 - File upload not working in File Manager in pgAdmin4 Runtime
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: RM1397 - File upload not working in File Manager in pgAdmin4 Runtime
@ 2016-08-04 12:59 Surinder Kumar <[email protected]>
  2016-08-04 15:34 ` Re: [pgAdmin4][Patch]: RM1397 - File upload not working in File Manager in pgAdmin4 Runtime Dave Page <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Surinder Kumar @ 2016-08-04 12:59 UTC (permalink / raw)
  To: pgadmin-hackers

Hi

*Issue:*
When a file is uploaded via FileManager it gets storage directory path from
STORAGE_DIR config variable. but in case of pgAdmin4 Runtime it is set to
None, that means STORAGE_DIR path should be the root directory.

The path formed to file was "None/filename.ext'. but it should be
'/filename.txt' which is now fixed.
Please find attached patch and review.

Thanks,
Surinder Kumar


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] RM1397.patch (875B, 3-RM1397.patch)
  download | inline diff:
diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py
index d788b9e..0fe6f04 100644
--- a/web/pgadmin/misc/file_manager/__init__.py
+++ b/web/pgadmin/misc/file_manager/__init__.py
@@ -242,13 +242,15 @@ class Filemanager(object):
         self.trans_id = trans_id
         self.patherror = encode_json(
             {
-                'Error': gettext('No permission to operate on specified path.'),
+                'Error': gettext('No permission to operate on \
+                                  specified path.'),
                 'Code': -1
             }
         )
         self.dir = get_storage_directory()

-        if self.dir is not None and isinstance(self.dir, list):
+        if ((self.dir is not None and isinstance(self.dir, list)) or
+           self.dir is None):
             self.dir = ""

     @staticmethod


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin4][Patch]: RM1397 - File upload not working in File Manager in pgAdmin4 Runtime
  2016-08-04 12:59 [pgAdmin4][Patch]: RM1397 - File upload not working in File Manager in pgAdmin4 Runtime Surinder Kumar <[email protected]>
@ 2016-08-04 15:34 ` Dave Page <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2016-08-04 15:34 UTC (permalink / raw)
  To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Thu, Aug 4, 2016 at 1:59 PM, Surinder Kumar
<[email protected]> wrote:
> Hi
>
> Issue:
> When a file is uploaded via FileManager it gets storage directory path from
> STORAGE_DIR config variable. but in case of pgAdmin4 Runtime it is set to
> None, that means STORAGE_DIR path should be the root directory.
>
> The path formed to file was "None/filename.ext'. but it should be
> '/filename.txt' which is now fixed.
> Please find attached patch and review.
>
> Thanks,
> Surinder Kumar
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-08-04 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04 12:59 [pgAdmin4][Patch]: RM1397 - File upload not working in File Manager in pgAdmin4 Runtime Surinder Kumar <[email protected]>
2016-08-04 15:34 ` Dave Page <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox