6 hour minimum for craigslist

This commit is contained in:
Samuel Clay 2020-04-06 09:42:11 -04:00
parent 4c02f0fa7a
commit 27096549a9
5 changed files with 23 additions and 14 deletions

View file

@ -184,19 +184,21 @@ def login(request):
@render_to('accounts/signup.html')
def signup(request):
if request.method == "POST":
signup_form = SignupForm(request.POST, prefix='signup')
return {
"form": signup_form
}
# form = SignupForm(prefix='signup', data=request.POST)
# if form.is_valid():
# new_user = form.save()
# login_user(request, new_user)
# logging.user(new_user, "~FG~SB~BBNEW SIGNUP: ~FW%s" % new_user.email)
# if not new_user.is_active:
# url = "https://%s%s" % (Site.objects.get_current().domain,
# reverse('stripe-form'))
# return HttpResponseRedirect(url)
if settings.ENFORCE_SIGNUP_CAPTCHA:
signup_form = SignupForm(request.POST, prefix='signup')
return {
"form": signup_form
}
form = SignupForm(prefix='signup', data=request.POST)
if form.is_valid():
new_user = form.save()
login_user(request, new_user)
logging.user(new_user, "~FG~SB~BBNEW SIGNUP: ~FW%s" % new_user.email)
if not new_user.is_active:
url = "https://%s%s" % (Site.objects.get_current().domain,
reverse('stripe-form'))
return HttpResponseRedirect(url)
return index(request)

View file

@ -2152,7 +2152,11 @@ class Feed(models.Model):
if len(fetch_history['push_history']):
total = total * 12
# 3 hour max for premiums, 48 hour max for free
# Craigslist feeds get 6 hours minimum
if 'craigslist' in self.feed_address:
total = max(total, 60*6)
# 4 hour max for premiums, 48 hour max for free
if subs >= 1:
total = min(total, 60*4*1)
else:

View file

@ -24,6 +24,7 @@ MEDIA_URL = '/media/'
SECRET_KEY = 'YOUR SECRET KEY'
AUTO_PREMIUM_NEW_USERS = True
AUTO_ENABLE_NEW_USERS = True
ENFORCE_SIGNUP_CAPTCHA = False
CACHES = {
'default': {

View file

@ -24,6 +24,7 @@ MEDIA_URL = '/media/'
SECRET_KEY = 'YOUR SECRET KEY'
AUTO_PREMIUM_NEW_USERS = True
AUTO_ENABLE_NEW_USERS = True
ENFORCE_SIGNUP_CAPTCHA = False
# CACHE_BACKEND = 'dummy:///'
# CACHE_BACKEND = 'locmem:///'

View file

@ -80,6 +80,7 @@ HOMEPAGE_USERNAME = 'popular'
ALLOWED_HOSTS = ['*']
AUTO_PREMIUM_NEW_USERS = False
AUTO_ENABLE_NEW_USERS = True
ENFORCE_SIGNUP_CAPTCHA = True
PAYPAL_TEST = False
# Uncomment below to force all feeds to store this many stories. Default is to cut