Revision 370ce61c flowspec/views.py

b/flowspec/views.py
118 118
            form.save_m2m()
119 119
            route.commit_add()
120 120
            requesters_address = request.META['HTTP_X_FORWARDED_FOR']
121
            mail_body = render_to_string("rule_add_mail.txt",
122
                                             {"route": route, "address": requesters_address})
121
            fqdn = Site.objects.get_current().domain
122
            admin_url = "https://%s%s" % (fqdn, "/fod/edit/%s"%route.name)
123
            mail_body = render_to_string("rule_action.txt",
124
                                             {"route": route, "address": requesters_address, "action": "creation", "url": admin_url})
123 125
            user_mail = "%s" %route.applier.email
124 126
            user_mail = user_mail.split(';')
125 127
            send_new_mail(settings.EMAIL_SUBJECT_PREFIX + "Rule %s creation request submitted by %s" %(route.name, route.applier.username),
......
189 191
                form.save_m2m()
190 192
                route.commit_edit()
191 193
                requesters_address = request.META['HTTP_X_FORWARDED_FOR']
192
                mail_body = render_to_string("rule_edit_mail.txt",
193
                                             {"route": route, "address": requesters_address})
194
                fqdn = Site.objects.get_current().domain
195
                admin_url = "https://%s%s" % (fqdn, "/fod/edit/%s"%route.name)
196
                mail_body = render_to_string("rule_action.txt",
197
                                             {"route": route, "address": requesters_address, "action": "edit", "url": admin_url})
194 198
                user_mail = "%s" %route.applier.email
195 199
                user_mail = user_mail.split(';')
196 200
                send_new_mail(settings.EMAIL_SUBJECT_PREFIX + "Rule %s edit request submitted by %s" %(route.name, route.applier.username),
......
239 243
            route.save()
240 244
            route.commit_delete()
241 245
            requesters_address = request.META['HTTP_X_FORWARDED_FOR']
242
            mail_body = render_to_string("rule_delete_mail.txt",
243
                                             {"route": route, "address": requesters_address})
246
            fqdn = Site.objects.get_current().domain
247
            admin_url = "https://%s%s" % (fqdn, "/fod/edit/%s"%route.name)
248
            mail_body = render_to_string("rule_action.txt",
249
                                             {"route": route, "address": requesters_address, "action": "removal", "url": admin_url})
244 250
            user_mail = "%s" %route.applier.email
245 251
            user_mail = user_mail.split(';')
246 252
            send_new_mail(settings.EMAIL_SUBJECT_PREFIX + "Rule %s removal request submitted by %s" %(route.name, route.applier.username), 

Also available in: Unified diff