<commit_before>from django.views.generic import TemplateView
import json


class Webhook(TemplateView):
    template_name = "_www/index.html"

    def get(self, request, *args, **kwargs):
        return super(Webhook, self).get(request, *args, **kwargs)

    def post(self, request, *args, **kwargs):
        d = json.loads(request.body.decode())
        print(d)
        return super(Webhook, self).post(request, *args, **kwargs)<commit_msg>Only accept master events<commit_after>from django.views.generic import TemplateView
import json


class Webhook(TemplateView):
    template_name = "_www/index.html"

    def get(self, request, *args, **kwargs):
        return super(Webhook, self).get(request, *args, **kwargs)

    def post(self, request, *args, **kwargs):
        d = json.loads(request.body.decode())
        if d['ref'] == 'refs/heads/master':
            print('Do pull & deploy')
        return super(Webhook, self).post(request, *args, **kwargs)
{'fraction_non_alphanumeric': 0.14568158168574402, 'fraction_numerical': 0.0, 'mean_word_length': 3.6473429951690823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4778658', 'n_tokens_mistral': 293, 'n_tokens_neox': 286, 'n_words': 73}