Media Conflict Warning not allowing saving of data.

HI everyone i am having an issue where my code fails to save data. I havent had this problem previously and was working fine until recently when i noticed users were complaining about not being able to save and upload receipts.

/home/peugeotclubmalaysia/.virtualenvs/django2/lib/python3.6/site-packages/django/forms/ MediaOrderConflictWarning: Detected duplicate Media files in an opposite order:
2021-01-06 11:53:35,809: admin/js/calendar.js
2021-01-06 11:53:35,809: admin/js/inlines.js
2021-01-06 11:53:35,810:   MediaOrderConflictWarning,

I saw that there is an issue that was raised and fixed. But unsure how to do it.
Need some advise on what i need to change. I am using the widgets provided by Django and not some custom .js files.

What would i need to share for anyone to get a clear picture of what is happening.

class MembershipRenew(LoginRequiredMixin, generic.FormView):
    template_name = 'pcmappv2/renewmember.html'
    model = Payment
    form_class = MembershipRenewForm
    success_url = 'success'

    def get_context_data(self, **kwargs):
        context = super(MembershipRenew, self).get_context_data(**kwargs)
        context['member'] = get_object_or_404(Member, owner=self.request.user)
        return context

    def get(self, request, *args, **kwargs):
        initial = {'payment_car_reg_no': get_object_or_404(
            Member, owner=self.request.user)}
        self.object = None
        form_class = self.get_form_class()
        form = self.form_class(initial=self.initial)
        #form = self.get_form(form_class)
        #form.instance.payment_car_reg_no = get_object_or_404(Member,owner=self.request.user)
        # form..payment_car_reg_no=get_object_or_404(Member,owner=self.request.user)
        return self.render_to_response(

    def post(self, request, *args, **kwargs):
        self.object = None
        form_class = self.get_form_class()
        #form = self.get_form(form_class)
        form = MembershipRenewForm(self.request.POST, self.request.FILES)
        # form['payment_car_reg_no']=self.request.user
        ''' Begin reCAPTCHA validation '''
        recaptcha_response = request.POST.get('g-recaptcha-response')
        data = {
            'secret': settings.GOOGLE_RECAPTCHA_SECRET_KEY,
            'response': recaptcha_response
        r =
            '', data=data)
        result = r.json()

        ''' End reCAPTCHA validation '''

        if (form.is_valid() and result['success']):
            return self.form_valid(form)
            return self.form_invalid(form)

    def form_valid(self, form):
        payment =
        payment.payment_car_reg_no = get_object_or_404(
            Member, owner=self.request.user)
        #self.object =
        return HttpResponseRedirect(self.get_success_url())

    def form_invalid(self, form):
        return self.render_to_response(


{%extends 'pcmappv2/base-site.html'%}
{% load bootstrap4 %}
{% bootstrap_css %}
{% bootstrap_javascript jquery='full' %}
{%block content%}
<section id="main">
  <div class="inner">
      <h2>Renew Membership</h2>
      <p>Please attach the details of your payment.</p>

    <!-- Form are -->
    <h3>Payment Details</h3>
    Renewal for {{member.member_name}}
    <form method="post" enctype="multipart/form-data" action="#" class="form">
      {% csrf_token %}

      <div class="row uniform 50%">
        <div class="6u 12u$(xsmall)">
          {%bootstrap_form form%}

      <div class="12u$">
        <script src=''></script>
        <div class="g-recaptcha" data-sitekey="6Lds744UAAAAABwLNPW-aNRFkl6_MA2i60y6YDkr"></div>
<!--        <script src=''></script>
        <div class="g-recaptcha" data-sitekey="6LfLRGwUAAAAAHHsE0huKka-Ze4-CXkYqz4OYU-f"></div> -->
        {% bootstrap_button "Save" button_type="submit" button_class="btn special" %}


class MembershipRenewForm(forms.ModelForm):
    class Meta:
        model = Payment
        fields = ['payment_car_reg_no', 'payment_date',
                  'payment_amount', 'payment_type', 'payment_receipt_image']
        widgets = {'payment_date': forms.DateInput(
            attrs={'type': 'date', 'format': 'YYYY-MM-DD'})}
        exclude = ['payment_car_reg_no']

I’ve never seen this error before. It appears to be generated in only one place - django/ at b1821fbad5518c8ae56b7b5c2b1ea2afbbd25c7a · django/django · GitHub

The impression that I’m getting from reading the source code is that this would be thrown in the case where you have some type of circular dependencies among either your JS or CSS files. (Simply, something like A depends on B, B depends on C, and C depends on A)

You might need to do some research and even read the sources of those files to determine where these dependencies are created.

So the good news is that it doesn’t appear to be related to the files being uploaded themselves, rather it’s an issue probably caused by a static file.

Since calendar.js and inlines.js are highlighted in the error message posted, that would be where I would start to investigate this.