Fix an issue with mentions caused by last update

This commit is contained in:
Jason McBrayer 2019-01-18 08:03:38 -05:00
parent aa1434e821
commit 7c351ef341
4 changed files with 9 additions and 11 deletions

View File

@ -193,5 +193,5 @@ SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
ANONYMOUS_HOME_URL = 'about'
# Version number displayed on about page
BRUTALDON_VERSION = "2.8.0"
BRUTALDON_VERSION = "2.8.1"

View File

@ -21,7 +21,7 @@
required="" id="id_status"
ic-post-to="{% url "user_search" %}"
ic-trigger-on="keyup changed" ic-trigger-delay="500ms"
ic-target="#username_autocomplete"></textarea>
ic-target="#username_autocomplete">{% if form.status.value %}{{ form.status.value }}{% endif %}</textarea>
<div id="username_autocomplete"></div>
</div>
<div id="status_count"></div>

View File

@ -28,7 +28,7 @@
required="" id="id_status"
ic-post-to="{% url "user_search" %}"
ic-trigger-on="keyup changed" ic-trigger-delay="500ms"
ic-target="#username_autocomplete"></textarea>
ic-target="#username_autocomplete">{% if form.status.value %}{{ form.status.value }}{% endif %}</textarea>
<div id="username_autocomplete"></div>
</div>
<div id="status_count"></div>

View File

@ -453,12 +453,10 @@ def toot(request, mention=None):
if mention:
if not mention.startswith('@'):
mention = '@'+mention
form = PostForm(request.GET, request.FILES,
initial={'visibility': request.session['user'].source.privacy,
'status': mention + '\n' })
form = PostForm(initial={'visibility': request.session['user'].source.privacy,
'status': mention + ' ' })
else:
form = PostForm(request.GET, request.FILES,
initial={'visibility': request.session['user'].source.privacy})
form = PostForm(initial={'visibility': request.session['user'].source.privacy})
if request.GET.get('ic-request'):
return render(request, 'intercooler/post.html',
{'form': form,
@ -590,9 +588,9 @@ def reply(request, id):
initial_text = ""
for mention in [x for x in toot.mentions if x.acct != request.session['user'].acct]:
initial_text +=('@' + mention.acct + " ")
form = PostForm({'status': initial_text,
'visibility': toot.visibility,
'spoiler_text': toot.spoiler_text})
form = PostForm(initial={'status': initial_text,
'visibility': toot.visibility,
'spoiler_text': toot.spoiler_text})
return render(request, 'main/reply.html',
{'context': context, 'toot': toot, 'form': form, 'reply':True,
'own_acct': request.session['user'],