Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when going to download requests #68

Open
jkeifer opened this issue Aug 29, 2017 · 1 comment
Open

Error when going to download requests #68

jkeifer opened this issue Aug 29, 2017 · 1 comment

Comments

@jkeifer
Copy link
Member

jkeifer commented Aug 29, 2017

Here is the traceback. I think it is because I didn't have any downloads.

AttributeError at /accounts/downloads/
'NoneType' object has no attribute 'name'
Request Method:	GET
Request URL:	https://test.ebagis.geog.pdx.edu/accounts/downloads/
Django Version:	1.11.3
Exception Type:	AttributeError
Exception Value:	
'NoneType' object has no attribute 'name'
Exception Location:	D:\projects\ebagis\testing\ebagis_beta\django-ebagis\ebagis\models\download.py in filename, line 44
Python Executable:	C:\Anaconda_x86\envs\ebagis_beta\python.exe
Python Version:	2.7.13
Python Path:	
['D:\\projects\\ebagis\\testing\\ebagis_beta\\django-ebagis',
 'D:\\projects\\ebagis\\testing\\ebagis_beta\\django-ebagis',
 u'c:\\program files (x86)\\arcgis\\desktop10.3\\arcpy',
 'D:\\projects\\ebagis\\testing\\ebagis_beta\\django-ebagis',
 'C:\\Anaconda_x86\\envs\\ebagis_beta\\python27.zip',
 'C:\\Anaconda_x86\\envs\\ebagis_beta\\DLLs',
 'C:\\Anaconda_x86\\envs\\ebagis_beta\\lib',
 'C:\\Anaconda_x86\\envs\\ebagis_beta\\lib\\plat-win',
 'C:\\Anaconda_x86\\envs\\ebagis_beta\\lib\\lib-tk',
 'C:\\Anaconda_x86\\envs\\ebagis_beta',
 'C:\\Anaconda_x86\\envs\\ebagis_beta\\lib\\site-packages',
 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\bin',
 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\ArcPy',
 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\ArcToolBox\\Scripts',
 'd:\\projects\\ebagis\\testing\\ebagis_beta\\django-ebagis',
 'C:\\Anaconda_x86\\envs\\ebagis_beta']
Server time:	Mon, 28 Aug 2017 17:41:06 -0700
@jkeifer
Copy link
Member Author

jkeifer commented Sep 4, 2017

Actually, this is because an AOI I uploaded had been deleted. The correct solution here is to do two things:

  1. Don't actually delete anything when something is "deleted". The removed_at timestamp should be set and there should be a method on every model checking whether an object is valid, i.e., not removed. We can then filter everything all the time based on that method.

  2. We need a cleanup process to run periodically to remove all deleted filesystem objects. In other words, if an AOI was deleted 30 days ago, the process should see that has been in a removed state for a sufficient amount of time to be cleaned up, and then it will delete all files referenced by paths in the AOI and its data records. The paths will also be set to '', indicating they have been cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant