[GeoNode-users] documents upload by URL

Simone Dalmasso simone.dalmasso at gmail.com
Fri Apr 7 04:53:17 PDT 2017


yes the extension is needed to treat thumbnails and detail pages in
different ways.

2017-04-07 10:26 GMT+02:00 Eugenio Trumpy <frippe12573 at hotmail.com>:

> Thank you Simone for your feedback.
>
> What about to remove 'not null' to the 'extension' field in table
> base_link?
>
>
> I tried and it works. Is that a too simple solution?
>
>
> Just a note, once the document with short URL has been registered it
> doesn't appear the regular pdf icon. I Think this should be related, isn't
> it?
>
>
> E.
>
>
>
>
>
> ------------------------------
> *Da:* Simone Dalmasso <simone.dalmasso at gmail.com>
> *Inviato:* venerdì 7 aprile 2017 08.55
> *A:* Eugenio Trumpy; geonode-users at lists.osgeo.org
> *Oggetto:* Re: [GeoNode-users] documents upload by URL
>
> Documents requires the extension thus short URLs don't work. Is not a bug
> but might be a good feature if someone will make a pr.
>
>
>
> Il giorno ven 7 apr 2017 alle 04:22 Eugenio Trumpy <
> frippe12573 at hotmail.com> ha scritto:
>
>> Hi all,
>>
>>
>> I was trying to insert a document in geonode 2.4 by using title and URL
>> (without upload the file).
>>
>> If the URL contains in the end the file extension everything works fine,
>> otherwise if I use
>>
>> a generated short link (e.g. https://goo.gl/d5q4hZ)
>>
>> I got this error:
>> Thu Apr 06 13:46:17.129074 2017] [:error] [pid 25821] Internal Server
>> Error: /documents/upload
>> [Thu Apr 06 13:46:17.129220 2017] [:error] [pid 25821] Traceback (most
>> recent call last):
>> [Thu Apr 06 13:46:17.129228 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py",
>> line 112, in get_response
>> [Thu Apr 06 13:46:17.129234 2017] [:error] [pid 25821]     response =
>> wrapped_callback(request, *callback_args, **callback_kwargs)
>> [Thu Apr 06 13:46:17.129240 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py",
>> line 22, in _wrapped_view
>> [Thu Apr 06 13:46:17.129246 2017] [:error] [pid 25821]     return
>> view_func(request, *args, **kwargs)
>> [Thu Apr 06 13:46:17.129251 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py",
>> line 69, in view
>> [Thu Apr 06 13:46:17.129256 2017] [:error] [pid 25821]     return
>> self.dispatch(request, *args, **kwargs)
>> [Thu Apr 06 13:46:17.129261 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py",
>> line 87, in dispatch
>> [Thu Apr 06 13:46:17.129364 2017] [:error] [pid 25821]     return
>> handler(request, *args, **kwargs)
>> [Thu Apr 06 13:46:17.129466 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/views/generic/edit.py",
>> line 205, in post
>> [Thu Apr 06 13:46:17.129541 2017] [:error] [pid 25821]     return
>> super(BaseCreateView, self).post(request, *args, **kwargs)
>> [Thu Apr 06 13:46:17.129595 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/views/generic/edit.py",
>> line 171, in post
>> [Thu Apr 06 13:46:17.129647 2017] [:error] [pid 25821]     return
>> self.form_valid(form)
>> [Thu Apr 06 13:46:17.129743 2017] [:error] [pid 25821]   File
>> "/dati/geonode/geonode/documents/views.py", line 158, in form_valid
>> [Thu Apr 06 13:46:17.129954 2017] [:error] [pid 25821]
>> self.object.save()
>> [Thu Apr 06 13:46:17.130137 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/polymorphic/polymorphic_model.py",
>> line 90, in save
>> [Thu Apr 06 13:46:17.130338 2017] [:error] [pid 25821]     return
>> super(PolymorphicModel, self).save(*args, **kwargs)
>> [Thu Apr 06 13:46:17.130526 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
>> 545, in save
>> [Thu Apr 06 13:46:17.130645 2017] [:error] [pid 25821]
>> force_update=force_update, update_fields=update_fields)
>> [Thu Apr 06 13:46:17.130718 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
>> 582, in save_base
>> [Thu Apr 06 13:46:17.130759 2017] [:error] [pid 25821]
>> update_fields=update_fields, raw=raw, using=using)
>> [Thu Apr 06 13:46:17.130900 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py",
>> line 185, in send
>> [Thu Apr 06 13:46:17.130981 2017] [:error] [pid 25821]     response =
>> receiver(signal=self, sender=sender, **named)
>> [Thu Apr 06 13:46:17.131213 2017] [:error] [pid 25821]   File
>> "/dati/geonode/geonode/documents/models.py", line 200, in
>> post_save_document
>> [Thu Apr 06 13:46:17.131311 2017] [:error] [pid 25821]
>> link_type='data',))
>> [Thu Apr 06 13:46:17.131407 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py",
>> line 154, in get_or_create
>> [Thu Apr 06 13:46:17.131468 2017] [:error] [pid 25821]     return
>> self.get_queryset().get_or_create(**kwargs)
>> [Thu Apr 06 13:46:17.131555 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line
>> 391, in get_or_create
>> [Thu Apr 06 13:46:17.131639 2017] [:error] [pid 25821]
>> six.reraise(*exc_info)
>> [Thu Apr 06 13:46:17.131724 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line
>> 383, in get_or_create
>> [Thu Apr 06 13:46:17.131799 2017] [:error] [pid 25821]
>> obj.save(force_insert=True, using=self.db)
>> [Thu Apr 06 13:46:17.131867 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
>> 545, in save
>> [Thu Apr 06 13:46:17.131969 2017] [:error] [pid 25821]
>> force_update=force_update, update_fields=update_fields)
>> [Thu Apr 06 13:46:17.132086 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
>> 573, in save_base
>> [Thu Apr 06 13:46:17.132144 2017] [:error] [pid 25821]     updated =
>> self._save_table(raw, cls, force_insert, force_update, using, update_fields)
>> [Thu Apr 06 13:46:17.132241 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
>> 654, in _save_table
>> [Thu Apr 06 13:46:17.132399 2017] [:error] [pid 25821]     result =
>> self._do_insert(cls._base_manager, using, fields, update_pk, raw)
>> [Thu Apr 06 13:46:17.132488 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
>> 687, in _do_insert
>> [Thu Apr 06 13:46:17.132585 2017] [:error] [pid 25821]     using=using,
>> raw=raw)
>> [Thu Apr 06 13:46:17.132646 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py",
>> line 232, in _insert
>> [Thu Apr 06 13:46:17.132747 2017] [:error] [pid 25821]     return
>> insert_query(self.model, objs, fields, **kwargs)
>> [Thu Apr 06 13:46:17.132804 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line
>> 1514, in insert_query
>> [Thu Apr 06 13:46:17.132874 2017] [:error] [pid 25821]     return
>> query.get_compiler(using=using).execute_sql(return_id)
>> [Thu Apr 06 13:46:17.132942 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py",
>> line 903, in execute_sql
>> [Thu Apr 06 13:46:17.133008 2017] [:error] [pid 25821]
>> cursor.execute(sql, params)
>> [Thu Apr 06 13:46:17.133085 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py",
>> line 69, in execute
>> [Thu Apr 06 13:46:17.133131 2017] [:error] [pid 25821]     return
>> super(CursorDebugWrapper, self).execute(sql, params)
>> [Thu Apr 06 13:46:17.133227 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py",
>> line 53, in execute
>> [Thu Apr 06 13:46:17.133309 2017] [:error] [pid 25821]     return
>> self.cursor.execute(sql, params)
>> [Thu Apr 06 13:46:17.133400 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 99, in
>> __exit__
>> [Thu Apr 06 13:46:17.133486 2017] [:error] [pid 25821]
>> six.reraise(dj_exc_type, dj_exc_value, traceback)
>> [Thu Apr 06 13:46:17.133557 2017] [:error] [pid 25821]   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py",
>> line 53, in execute
>> [Thu Apr 06 13:46:17.133661 2017] [:error] [pid 25821]     return
>> self.cursor.execute(sql, params)
>> [Thu Apr 06 13:46:17.133721 2017] [:error] [pid 25821] IntegrityError:
>> null value in column "extension" violates not-null constraint
>> [Thu Apr 06 13:46:17.133808 2017] [:error] [pid 25821] DETAIL:  Failing
>> row contains (2772, 134, null, data, External Document, text/plain,
>> https://goo.gl/F7sQB8)
>>
>>
>> Is that a bug? Do you know a workaround?
>>
>>
>> E.
>> _______________________________________________
>> geonode-users mailing list
>> geonode-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/geonode-users
>>
> --
> Simone
>



-- 
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20170407/6f622fa6/attachment-0001.html>


More information about the geonode-users mailing list