mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-14 02:41:26 +01:00
Merge branch 'develop' into bootstrap4
This commit is contained in:
commit
5940b706c1
@ -362,11 +362,13 @@ def ticket_from_message(message, queue, logger):
|
|||||||
|
|
||||||
if not body:
|
if not body:
|
||||||
mail = BeautifulSoup(part.get_payload(), "lxml")
|
mail = BeautifulSoup(part.get_payload(), "lxml")
|
||||||
if ">" in mail.text:
|
beautiful_body = mail.find('body')
|
||||||
body = mail.find('body')
|
if beautiful_body:
|
||||||
body = body.text
|
try:
|
||||||
body = body.encode('ascii', errors='ignore')
|
body = beautiful_body.text
|
||||||
else:
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
if not body:
|
||||||
body = mail.text
|
body = mail.text
|
||||||
|
|
||||||
if ticket:
|
if ticket:
|
||||||
|
@ -1060,7 +1060,7 @@ class KBItem(models.Model):
|
|||||||
An item within the knowledgebase. Very straightforward question/answer
|
An item within the knowledgebase. Very straightforward question/answer
|
||||||
style system.
|
style system.
|
||||||
"""
|
"""
|
||||||
voted_by= models.ManyToManyField(settings.AUTH_USER_MODEL)
|
voted_by = models.ManyToManyField(settings.AUTH_USER_MODEL)
|
||||||
category = models.ForeignKey(
|
category = models.ForeignKey(
|
||||||
KBCategory,
|
KBCategory,
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
|
@ -47,7 +47,7 @@ def vote(request, item):
|
|||||||
item = get_object_or_404(KBItem, pk=item)
|
item = get_object_or_404(KBItem, pk=item)
|
||||||
vote = request.GET.get('vote', None)
|
vote = request.GET.get('vote', None)
|
||||||
if vote in ('up', 'down'):
|
if vote in ('up', 'down'):
|
||||||
if request.user not in item.voted_by:
|
if request.user not in item.voted_by:
|
||||||
|
|
||||||
item.votes += 1
|
item.votes += 1
|
||||||
if vote == 'up':
|
if vote == 'up':
|
||||||
|
Loading…
Reference in New Issue
Block a user