python - djstripe customers not deleted -


i have test website using stripe , djstripe 0.8.0 subscription payments.

i had test data set test payments system working.

i deleted stripe test data.

however, when open django admin console , navigate djstripe > customers, have following records displayed, no users/customers attached them:

enter image description here

there no records in corresponding database table. have deleted customers stripe , database itself. still cannot rid of these records.

if try access records or delete records admin console, receive following error message:

attributeerror: 'nonetype' object has no attribute 'email'

  file "c:\users\me\desktop\myappname\env3\lib\site-packages\djstripe\settings.py", line 94, in get_subscriber_model_check_subscriber_for_email_address(subscriber_model, "the customer user model must have email attribute.")   file "c:\users\me\desktop\myappname\env3\lib\site-packages\djstripe\settings.py", line 70, in _check_subscriber_for_email_address     if ("email" not in subscriber_model._meta.get_all_field_names()) , not has attr(subscriber_model, 'email'): attributeerror: 'options' object has no attribute 'get_all_field_names' 

how delete these records?

first i'd recommend updating latest djstripe version (i believe it's 1.0.0 of now)

about deleting records: looking models.py class customer djstripe, it's clear deleting default_source (i.e. stripe customer) not intended delete customer djstripe tables

class customer(stripecustomer): ... default_source = foreignkey(stripesource, null=true, related_name="customers", on_delete=set_null) 

as set on_delete=set_null

i either reach out authors of djstripe (authors) (daniel greenfield great guy) or raise issue on corresponding github page (github djstripe)

in general think, software initiate deletion of subscription. deleting them in stripe interface leaves code , djstripe matter out in cold open :)

as hardcore fix, i'd go directly corresponding database , delete records.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -