Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Fix an issue with mentions caused by last update
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmcbrayer committed Jan 18, 2019
1 parent aa1434e commit 7c351ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion brutaldon/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@
ANONYMOUS_HOME_URL = 'about'

# Version number displayed on about page
BRUTALDON_VERSION = "2.8.0"
BRUTALDON_VERSION = "2.8.1"

2 changes: 1 addition & 1 deletion brutaldon/templates/main/post_minimal_partial.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion brutaldon/templates/main/post_partial.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
14 changes: 6 additions & 8 deletions brutaldon/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit 7c351ef

Please sign in to comment.