mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Merge branch 'master' into offline
* master: Fixing broken content from RSS feed when summary is actually longer. Adding auto-enable free users setting for local installs.
This commit is contained in:
commit
4dc499137c
5 changed files with 21 additions and 5 deletions
|
@ -4,6 +4,7 @@ from django.utils.translation import ugettext_lazy as _
|
|||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import authenticate
|
||||
from django.db.models import Q
|
||||
from django.conf import settings
|
||||
from apps.reader.models import Feature
|
||||
from apps.profile.tasks import EmailNewUser
|
||||
from apps.social.models import MActivity
|
||||
|
@ -147,6 +148,11 @@ class SignupForm(forms.Form):
|
|||
if new_user.email:
|
||||
EmailNewUser.delay(user_id=new_user.pk)
|
||||
|
||||
if getattr(settings, 'AUTO_PREMIUM_NEW_USERS', False):
|
||||
new_user.profile.activate_premium()
|
||||
elif getattr(settings, 'AUTO_ENABLE_NEW_USERS', False):
|
||||
new_user.profile.activate_free()
|
||||
|
||||
return new_user
|
||||
|
||||
class FeatureForm(forms.Form):
|
||||
|
|
|
@ -168,9 +168,10 @@ def signup(request):
|
|||
new_user = form.save()
|
||||
login_user(request, new_user)
|
||||
logging.user(new_user, "~FG~SB~BBNEW SIGNUP~FW")
|
||||
url = "https://%s%s" % (Site.objects.get_current().domain,
|
||||
reverse('stripe-form'))
|
||||
return HttpResponseRedirect(url)
|
||||
if not new_user.is_active:
|
||||
url = "https://%s%s" % (Site.objects.get_current().domain,
|
||||
reverse('stripe-form'))
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
return index(request)
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ DEBUG = True
|
|||
DEBUG_ASSETS = DEBUG
|
||||
MEDIA_URL = '/media/'
|
||||
SECRET_KEY = 'YOUR SECRET KEY'
|
||||
AUTO_PREMIUM_NEW_USERS = True
|
||||
AUTO_ENABLE_NEW_USERS = True
|
||||
|
||||
# CACHE_BACKEND = 'dummy:///'
|
||||
# CACHE_BACKEND = 'locmem:///'
|
||||
|
|
|
@ -75,6 +75,8 @@ CIPHER_USERNAMES = False
|
|||
DEBUG_ASSETS = DEBUG
|
||||
HOMEPAGE_USERNAME = 'popular'
|
||||
ALLOWED_HOSTS = ['*']
|
||||
AUTO_PREMIUM_NEW_USERS = False
|
||||
AUTO_ENABLE_NEW_USERS = False
|
||||
|
||||
# ===============
|
||||
# = Enviornment =
|
||||
|
|
|
@ -98,10 +98,15 @@ def pre_process_story(entry):
|
|||
entry['guid'] = unicode(entry['guid'])
|
||||
|
||||
# Normalize story content/summary
|
||||
summary = entry.get('summary', '')
|
||||
content = ""
|
||||
if not summary and 'summary_detail' in entry:
|
||||
summary = entry['summary_detail'].get('value', '')
|
||||
if entry.get('content'):
|
||||
entry['story_content'] = entry['content'][0].get('value', '').strip()
|
||||
content = entry['content'][0].get('value', '')
|
||||
if len(content) > len(summary):
|
||||
entry['story_content'] = content.strip()
|
||||
else:
|
||||
summary = entry.get('summary') or ''
|
||||
entry['story_content'] = summary.strip()
|
||||
|
||||
# Add each media enclosure as a Download link
|
||||
|
|
Loading…
Add table
Reference in a new issue