|
@@ -284,21 +284,31 @@ class ProductPublish(LoginRequiredMixin, DetailView):
|
|
|
|
|
|
|
|
if (contact.id == product.contact.id) :
|
|
if (contact.id == product.contact.id) :
|
|
|
|
|
|
|
|
- product_url = reverse( 'product-detail', kwargs= { 'pk': product.pk } )
|
|
|
|
|
- publishmessage = "Ein Benutzer möchte folgendes Projekt freigeben: {}, {}".format( product.name, request.get_host() + product_url )
|
|
|
|
|
-
|
|
|
|
|
- print (publishmessage)
|
|
|
|
|
-
|
|
|
|
|
- userList =User.objects.filter( is_superuser = 1 )
|
|
|
|
|
- for superuser in userList:
|
|
|
|
|
- mail.send(
|
|
|
|
|
- superuser.email, # List of email addresses also accepted
|
|
|
|
|
- config.EMAIL_NOREPLY,
|
|
|
|
|
- subject='Projekt Freischaltung',
|
|
|
|
|
- headers={ 'Reply-To': superuser.email },
|
|
|
|
|
- message= publishmessage,
|
|
|
|
|
- # html_message='Hi <strong>there</strong>!',
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ panel_url = reverse( 'admin-panel' )
|
|
|
|
|
+ publishmessage = "Ein Benutzer möchte folgendes Projekt freigeben: {}. Du kannst es über das Admin-Panel freigeben: {}".format( product.name, request.get_host() + panel_url )
|
|
|
|
|
+
|
|
|
|
|
+ # print (publishmessage)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ mail.send(
|
|
|
|
|
+ 'gemeinschaffen@realitylab.at', # List of email addresses also accepted
|
|
|
|
|
+ config.EMAIL_NOREPLY,
|
|
|
|
|
+ subject='Projekt Freischaltung',
|
|
|
|
|
+ headers={ 'Reply-To': 'gemeinschaffen@realitylab.at' },
|
|
|
|
|
+ message= publishmessage,
|
|
|
|
|
+ # html_message='Hi <strong>there</strong>!',
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ # userList =User.objects.filter( is_superuser = 1 )
|
|
|
|
|
+ # for superuser in userList:
|
|
|
|
|
+ # mail.send(
|
|
|
|
|
+ # superuser.email, # List of email addresses also accepted
|
|
|
|
|
+ # config.EMAIL_NOREPLY,
|
|
|
|
|
+ # subject='Projekt Freischaltung',
|
|
|
|
|
+ # headers={ 'Reply-To': superuser.email },
|
|
|
|
|
+ # message= publishmessage,
|
|
|
|
|
+ # # html_message='Hi <strong>there</strong>!',
|
|
|
|
|
+ # )
|
|
|
context = {}
|
|
context = {}
|
|
|
context["content_a"] = '<br><br><br>Die Freigabe wurde beantragt.<br><br><br>'
|
|
context["content_a"] = '<br><br><br>Die Freigabe wurde beantragt.<br><br><br>'
|
|
|
return render(request, self.template_name, context )
|
|
return render(request, self.template_name, context )
|
|
@@ -600,7 +610,7 @@ class GenericSearchView(SearchProductsView):
|
|
|
|
|
|
|
|
def dispatch(self, request, *args, **kwargs):
|
|
def dispatch(self, request, *args, **kwargs):
|
|
|
|
|
|
|
|
- print( kwargs['type'] )
|
|
|
|
|
|
|
+ # print( kwargs['type'] )
|
|
|
if self.kwargs['type'] == 'BASE':
|
|
if self.kwargs['type'] == 'BASE':
|
|
|
return super().dispatch(request, *args, **kwargs)
|
|
return super().dispatch(request, *args, **kwargs)
|
|
|
elif self.kwargs['type'] == 'WOHN':
|
|
elif self.kwargs['type'] == 'WOHN':
|