These are chat archives for django/django

11th
Nov 2016
J. Dalton Childers
@jdaltonchilders
Nov 11 2016 02:18

@mheppner

I just wanted to let everyone that was helping me early know I got the code to work.

<script type="text/javascript">
$(document).ready(function() {
    $('.remove_study').click(function() {
        swal({
            title: "Are you sure?",
            text: "You will not be able to recover the {{ study.name }} study!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, delete it!",
            cancelButtonText: "No, cancel please!",
            closeOnConfirm: false,
            closeOnCancel: true
        }, function() {
            $.ajax({
                type: 'POST',
                url: '{% url 'study_delete' pk=study.id %}',
                data: {
                    csrfmiddlewaretoken: '{{ csrf_token }}'
                }
            })
            .done(function() {
                swal({
                    title: "Deleted!",
                    text: "Your study has been deleted.",
                    type: "success"
                }, function() {
                    window.location = '/study';
                });
            })
            .error(function() {
                swal("Oops", "We couldn't connect to the server!", "error");
            });
        });
    });
});
</script>
erfanFarmer
@ErfanFarmer
Nov 11 2016 07:43
hi
Slava
@scream4ik
Nov 11 2016 08:56
hello
Miracle Ayodele
@iammiracle
Nov 11 2016 10:14
hi guys...I have been brainstorming wit authenticate function. @megapctr has been of help, but the function still returns None for me, when i tried authenticating on shell, it returned "True" but on my code, i get None
pls wat do could be the problem