2017-07-27 58 views
1

我有一個測試網站將使用條紋和djstripe 0.8.0訂閱付款。djstripe客戶不刪除

我將測試數據設置爲測試支付系統是否正常工作。

然後我刪除了條紋測試數據。

然而,當我打開Django管理控制檯並導航到djstripe>的客戶,我有以下的記錄顯示,而是重視他們沒有用戶/客戶:

enter image description here

有中沒有記錄相應的數據庫表。我甚至從條帶和數據庫本身刪除了客戶。仍然無法擺脫這些記錄。

如果我嘗試從管理控制檯訪問記錄或刪除記錄,我收到以下錯誤信息:

AttributeError的:「NoneType」對象有沒有屬性「郵件」

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 an 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()) and not has attr(subscriber_model, 'email'): 
AttributeError: 'Options' object has no attribute 'get_all_field_names' 

如何刪除這些記錄?

回答

0

首先我建議你更新到最新版本djstripe(我相信這是1.0.0截至目前)

關於刪除記錄:從 djstripe展望models.py 類客戶,很明顯,刪除default_source(即磁條客戶)不打算從djstripe表

class Customer(StripeCustomer): 
... 
default_source = ForeignKey(StripeSource, null=True, related_name="customers", on_delete=SET_NULL) 

,因爲它被設置爲on_delete = SET_N刪除客戶ULL

我要麼伸手djstripe的作者(authors)(丹尼爾·格林菲爾德是一個偉大的傢伙)或相應的GitHub頁面(Github djstripe

總的來說,我認爲在提出一個問題,你的軟件將啓動刪除訂閱。刪除他們在條紋界面留下你的代碼和djstripe在這個問題出冷開:) :)作爲核心修復,我會直接進入相應的數據庫並刪除這些記錄。