# if person applied for offline membership
if last_membership and not frappe.session.user == "Administrator":
# if last membership does not expire in 30 days, then do not allow to renew
if getdate(add_days(last_membership.to_date, -30)) > getdate(nowdate()) :
frappe.throw(_('You can only renew if your membership expires within 30 days'))
self.from_date = add_days(last_membership.to_date, 1)
elif frappe.session.user == "Administrator":
self.from_date = self.from_date
self.from_date = nowdate()
if frappe.db.get_single_value("Membership Settings", "billing_cycle") == "Yearly":
self.to_date = add_years(self.from_date, 1)
self.to_date = add_months(self.from_date, 1)
Now, my next question is, where is the “Membership settings” doctype? I see that it is what they call a “Single DocType” but I can’t find it in the GUI anywhere.
I just created a pull request to delete the forced 30-days period. According to the memberships code, there should be a setting in nonprofit settings to configure this, however there is no such setting.
In my opinion, this should not be forced and every organization should have the freedom to choose the billing cycle.