#36: Aircox ne reconnait pas les fichiers uploadés #75
@ -98,13 +98,10 @@ class Program(Page):
 | 
				
			|||||||
        Return a Program from the given path. We assume the path has been
 | 
					        Return a Program from the given path. We assume the path has been
 | 
				
			||||||
        given in a previous time by this model (Program.path getter).
 | 
					        given in a previous time by this model (Program.path getter).
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        if path.startswith(conf.MEDIA_ROOT):
 | 
					        if path.startswith(settings.AIRCOX_PROGRAMS_DIR):
 | 
				
			||||||
            path = path.replace(conf.MEDIA_ROOT + '/', '')
 | 
					            path = path.replace(settings.AIRCOX_PROGRAMS_DIR + '/', '')
 | 
				
			||||||
        path = path.replace(settings.AIRCOX_PROGRAMS_DIR, '')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        while path[0] == '/':
 | 
					        while path[0] == '/':
 | 
				
			||||||
            path = path[1:]
 | 
					            path = path[1:]
 | 
				
			||||||
 | 
					 | 
				
			||||||
        path = path[:path.index('/')]
 | 
					        path = path[:path.index('/')]
 | 
				
			||||||
        return cl.objects.filter(slug=path.replace('_','-')).first()
 | 
					        return cl.objects.filter(slug=path.replace('_','-')).first()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -86,8 +86,7 @@ ensure('AIRCOX_DEFAULT_USER_GROUPS', {
 | 
				
			|||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Directory for the programs data
 | 
					# Directory for the programs data
 | 
				
			||||||
# TODO: rename to PROGRAMS_ROOT
 | 
					ensure('AIRCOX_PROGRAMS_DIR', os.path.join(settings.MEDIA_ROOT, 'programs'))
 | 
				
			||||||
ensure('AIRCOX_PROGRAMS_DIR', 'programs')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
########################################################################
 | 
					########################################################################
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user