<div dir="ltr">No problems,<div><br></div><div>don't think there are plans to make it a table. it is an enumaration and all possible values are in base/enumerations.py.</div><div><br></div><div>Glad you solved.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-06 11:27 GMT+02:00 Haertel, Michael (IITA) <span dir="ltr"><<a href="mailto:M.Haertel@cgiar.org" target="_blank">M.Haertel@cgiar.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hello Simone,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Field “maintenance_frequency” in base_resourcebase is of type “character varying(255)”. I put “not planned” there for each of the datasets. But I noticed that
 for the manually added documents it is NULL. So I tried to set the value to null for an imported document and it WORKED!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">THANK YOU VERY MUCH!
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I also tried to put an empty String “” in there and it also works but as soon as I put a character in there I get the server error again! But now I see that
 there is a DropDown in GeoNode which provides the possible values for that field so it probably checks the contents of that field against a Lookup List.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Are there any plans to create a separate table for maintenance frequency and refer to those values with a key?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I didn’t think about the field maintenance_frequency even though it was clearly printed in the error log because I was just convinced that it was a free text
 field without double-checking the GUI in the application. Sorry about that.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">You saved my week, thanks again.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Have a nice weekend,<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Michael Haertel</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">GIS & Database Expert</span></i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">International Institute of Tropical Agriculture (IITA,
</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><a href="http://../../../AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/FGKNP1ID/www.iita.org" target="_blank"><b>www.iita.org</b></a></span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">)<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Headquarters and West Africa Hub</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">PMB 5320, Oyo Road, Ibadan 200001, Oyo State, Nigeria<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">International Mailing Address: IITA Limited, Part 7th Floor, Grosvenor House, 125 High Street, Croydon, Surrey, CR0 9XP<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Tel: <a href="tel:%2B234%202%207517472" value="+23427517472" target="_blank">+234 2 7517472</a>  |  USA Tel: <a href="tel:%2B1%20201%206336094" value="+12016336094" target="_blank">+1 201 6336094</a>  |  Fax: <a href="tel:%2B44%20208%207113786" value="+442087113786" target="_blank">+44 208 7113786</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">IITA is a member of the CGIAR Consortium</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"> (</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><a href="http://../../../AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/FGKNP1ID/www.cgiar.org" target="_blank"><span lang="EN-GB">www.cgiar.org</span></a></span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">)</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Simone Dalmasso [mailto:<a href="mailto:simone.dalmasso@gmail.com" target="_blank">simone.dalmasso@gmail.com</a>]
<br>
<b>Sent:</b> Friday, May 06, 2016 9:59 AM</span></p><div><div class="h5"><br>
<b>To:</b> Haertel, Michael (IITA)<br>
<b>Cc:</b> <a href="mailto:geonode-devel@lists.osgeo.org" target="_blank">geonode-devel@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [GeoNode-devel] after mass data import : "KeyError: 'request'" when clicking on a document<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">ok the error is that <span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">self.maintenance_frequency][0][1].title()</span>is empty. Did you correctly set it in base_resourcebase?<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">As a note base_resourcebase have to have the same id of the related document_document item.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Hope this helps!<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2016-05-06 10:40 GMT+02:00 Haertel, Michael (IITA) <<a href="mailto:M.Haertel@cgiar.org" target="_blank">M.Haertel@cgiar.org</a>>:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hello Simone,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thank you for attending to this so promptly.
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This is what is added to the error.log at the time I click on a link:</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634679 2016] [:error] [pid 2361] Internal Server Error: /documents/98</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634741 2016] [:error] [pid 2361] Traceback (most recent call last):</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634752 2016] [:error] [pid 2361]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py",
 line 112, in get_response</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634764 2016] [:error] [pid 2361]     response = wrapped_callback(request, *callback_args,
 **callback_kwargs)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634772 2016] [:error] [pid 2361]   File "/usr/local/lib/python2.7/dist-packages/geonode/documents/views.py",
 line 103, in document_detail</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634792 2016] [:error] [pid 2361]     context_dict["social_links"] = build_social_links(request,
 document)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634800 2016] [:error] [pid 2361]   File "/usr/local/lib/python2.7/dist-packages/geonode/utils.py",
 line 609, in build_social_links</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634808 2016] [:error] [pid 2361]     caveats = build_caveats(resourcebase)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634816 2016] [:error] [pid 2361]   File "/usr/local/lib/python2.7/dist-packages/geonode/utils.py",
 line 589, in build_caveats</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634824 2016] [:error] [pid 2361]     caveats.append(resourcebase.maintenance_frequency_title())</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634831 2016] [:error] [pid 2361]   File "/usr/local/lib/python2.7/dist-packages/geonode/base/models.py",
 line 613, in maintenance_frequency_title</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634839 2016] [:error] [pid 2361]     return [v for i, v in enumerate(UPDATE_FREQUENCIES)
 if v[0] == self.maintenance_frequency][0][1].title()</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.634859 2016] [:error] [pid 2361] IndexError: list index out of range</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.656303 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>] mod_wsgi (pid=2361): Exception occurred processing WSGI script '/var/www/geonode/wsgi/geonode.wsgi'.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.656511 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>] Traceback (most recent call last):</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.656645 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 206, in __call__</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.656779 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     response = self.get_response(request)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.656835 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 194, in get_response</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.656885 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.656966 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 236, in handle_uncaught_exception</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657032 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return callback(request, **param_dict)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657083 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/utils/decorators.py", line 99, in _wrapped_view</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657310 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     response = view_func(request, *args, **kwargs)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657345 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/views/defaults.py", line 46, in server_error</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657404 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return http.HttpResponseServerError(template.render(Context({})))</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657478 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 140, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657539 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return self._render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657587 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657625 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return self.nodelist.render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657673 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 840, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657787 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     bit = self.render_node(node, context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657856 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 854, in render_node</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657897 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return node.render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.657968 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/loader_tags.py", line 53, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658012 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     result = self.nodelist.render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658061 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 840, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658100 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     bit = self.render_node(node, context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658131 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 854, in render_node</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658171 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return node.render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658242 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/loader_tags.py", line 155, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658283 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return self.render_template(self.template, context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658311 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/loader_tags.py", line 137, in render_template</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658347 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     output = template.render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658375 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 140, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658410 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return self._render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658438 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658474 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return self.nodelist.render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658502 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 840, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658537 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     bit = self.render_node(node, context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658563 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/base.py", line 854, in render_node</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658598 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     return node.render(context)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658625 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/announcements/templatetags/announcements_tags.py", line 24, in render</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658662 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     request = context["request"]</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658890 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]   File "/usr/lib/python2.7/dist-packages/django/template/context.py", line 56, in __getitem__</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.658940 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>]     raise KeyError(key)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[Fri May 06 03:38:41.659002 2016] [:error] [pid 2361] [remote
<a href="http://127.0.0.1:20011" target="_blank">127.0.0.1:20011</a>] KeyError: 'request'</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regards,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Michael Haertel</span></b><u></u><u></u></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">GIS & Database Expert</span></i><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">International Institute of Tropical Agriculture (IITA,
</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><a href="http://../../../AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/FGKNP1ID/www.iita.org" target="_blank"><b>www.iita.org</b></a></span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">)</span></b><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Headquarters and West Africa Hub</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">PMB 5320, Oyo Road, Ibadan 200001, Oyo State, Nigeria</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">International Mailing Address: IITA Limited, Part 7th Floor, Grosvenor House, 125 High Street, Croydon,
 Surrey, CR0 9XP</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Tel:
<a href="tel:%2B234%202%207517472" target="_blank">+234 2 7517472</a>  |  USA Tel:
<a href="tel:%2B1%20201%206336094" target="_blank">+1 201 6336094</a>  |  Fax: <a href="tel:%2B44%20208%207113786" target="_blank">
+44 208 7113786</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">IITA is a member of the CGIAR Consortium</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">
 (</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><a href="http://../../../AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/FGKNP1ID/www.cgiar.org" target="_blank"><span lang="EN-GB">www.cgiar.org</span></a></span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Simone Dalmasso [mailto:<a href="mailto:simone.dalmasso@gmail.com" target="_blank">simone.dalmasso@gmail.com</a>]
<br>
<b>Sent:</b> Friday, May 06, 2016 9:36 AM<br>
<b>To:</b> Haertel, Michael (IITA)<br>
<b>Cc:</b> <a href="mailto:geonode-devel@lists.osgeo.org" target="_blank">geonode-devel@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [GeoNode-devel] after mass data import : "KeyError: 'request'" when clicking on a document</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">Hi, could you post the full trace of the error? is in /var/logs/apache2/error.log<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">2016-05-06 10:22 GMT+02:00 Haertel, Michael (IITA) <<a href="mailto:M.Haertel@cgiar.org" target="_blank">M.Haertel@cgiar.org</a>>:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Dear List,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I imported many datasets from a third party application into GeoNode by populating these database tables:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p>1.<span style="font-size:7.0pt">       </span>Base_resourcebase<u></u><u></u></p>
<p>2.<span style="font-size:7.0pt">       </span>Documents_document<u></u><u></u></p>
<p>3.<span style="font-size:7.0pt">       </span>Base_contactrole<u></u><u></u></p>
<p>4.<span style="font-size:7.0pt">       </span>Taggit_tag<u></u><u></u></p>
<p>5.<span style="font-size:7.0pt">       </span>Taggit_taggeditem<u></u><u></u></p>
<p>6.<span style="font-size:7.0pt">       </span>Base_link<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">However the link behind each document doesn’t work. I get an “Internal server error”. According to the log file the error is raised in
<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">-----</span><u></u><u></u></p>
<p class="MsoNormal">File "/usr/lib/python2.7/dist-packages/django/template/context.py", line 56, in __getitem__<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Raise KeyError(key)<u></u><u></u></p>
<p class="MsoNormal">KeyError: ‘request’<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">-----</span><u></u><u></u></p>
<p class="MsoNormal">I noticed that when I click on a link to a PDF document for the first time after it has been imported, the column “doc_file” is altered and a suffix is appended to the pdf file
 on disk. So I also checked file permissions but “www-data” (linux)  can write all files there. It only happens for the datasets that I imported myself. Manually added documents work fine.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I also noticed that for Ids that were manually added and removed afterwards, the links (url: documents/<id>) still work and lead to a “file not found” page without any “internal
 server error” message. So GeoNode somehow knows which ids are valid (accessible) and which are not. Can somebody tell me how it works?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I am not yet very good in python yet and I don’t want to debug the code at this point.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thank you very much for your assistance,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Michael Haertel</span></b><u></u><u></u></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">GIS & Database Expert</span></i><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4a452a">International Institute of Tropical Agriculture (IITA,
</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="http://../../../AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/FGKNP1ID/www.iita.org" target="_blank"><b>www.iita.org</b></a><b><span style="color:#4a452a">)</span></b></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Headquarters and West Africa Hub</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">PMB 5320, Oyo Road, Ibadan 200001, Oyo State, Nigeria</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">International Mailing Address: IITA Limited, Part 7th Floor, Grosvenor House, 125 High Street, Croydon, Surrey, CR0
 9XP</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif"">Tel:
<a href="tel:%2B234%202%207517472" target="_blank">+234 2 7517472</a>  |  USA Tel:
<a href="tel:%2B1%20201%206336094" target="_blank">+1 201 6336094</a>  |  Fax: <a href="tel:%2B44%20208%207113786" target="_blank">
+44 208 7113786</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">IITA is a member of the CGIAR Consortium</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif"">
 (</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="http://../../../AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/FGKNP1ID/www.cgiar.org" target="_blank"><span lang="EN-GB">www.cgiar.org</span></a></span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial","sans-serif"">)</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
geonode-devel mailing list<br>
<a href="mailto:geonode-devel@lists.osgeo.org" target="_blank">geonode-devel@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/geonode-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geonode-devel</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">--
<u></u><u></u></p>
<div>
<p class="MsoNormal">Simone <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Simone <u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Simone </div>
</div>