Application Icon upload (#341)
* core: add initial implementation for File Upload * root: add volumes to docker-compose for file upload * helm: add pvc for uploads * core: allow meta_icon to be overwritten with static files
This commit is contained in:
		
							
								
								
									
										23
									
								
								passbook/core/views/library.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								passbook/core/views/library.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,23 @@ | ||||
| """passbook library view""" | ||||
|  | ||||
| from django.contrib.auth.mixins import LoginRequiredMixin | ||||
| from django.views.generic import TemplateView | ||||
|  | ||||
| from passbook.core.models import Application | ||||
| from passbook.policies.engine import PolicyEngine | ||||
|  | ||||
|  | ||||
| class LibraryView(LoginRequiredMixin, TemplateView): | ||||
|     """Overview for logged in user, incase user opens passbook directly | ||||
|     and is not being forwarded""" | ||||
|  | ||||
|     template_name = "library.html" | ||||
|  | ||||
|     def get_context_data(self, **kwargs): | ||||
|         kwargs["applications"] = [] | ||||
|         for application in Application.objects.all().order_by("name"): | ||||
|             engine = PolicyEngine(application, self.request.user, self.request) | ||||
|             engine.build() | ||||
|             if engine.passing: | ||||
|                 kwargs["applications"].append(application) | ||||
|         return super().get_context_data(**kwargs) | ||||
		Reference in New Issue
	
	Block a user
	 Jens L
					Jens L