Merge pull request #845 from koriaf/dev-demo

Demo-related bugfixes
This commit is contained in:
Garret Wassermann 2020-07-20 10:55:53 -04:00 committed by GitHub
commit d4ac8a767d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -78,8 +78,9 @@ readme:
#: demo - Setup demo project using Python3.
.PHONY: demo
demo:
$(PIP) install -e . --user
$(PIP) install -e demo --user
# running it with and without --user flag because it started to be problematic for some setups
$(PIP) install -e . --user || $(PIP) install -e .
$(PIP) install -e demo --user || $(PIP) install -e demo
demodesk migrate --noinput
# Create superuser; user will be prompted to manually set a password
# When you get a prompt, enter a password of your choosing.

View File

@ -38,7 +38,12 @@ INSTALLED_APPS = [
'django.contrib.sites',
'django.contrib.humanize',
'bootstrap4form',
'helpdesk'
'account', # Required by pinax-teams
'pinax.invitations', # required by pinax-teams
'pinax.teams', # team support
'helpdesk', # This is us!
'reversion', # required by pinax-teams
]
MIDDLEWARE = [

View File

@ -97,7 +97,7 @@ class BaseCreateTicketView(abstract_views.AbstractCreateTicketMixin, FormView):
# This submission is spam. Let's not save it.
return render(request, template_name='helpdesk/public_spam.html')
else:
ticket = form.save()
ticket = form.save(user=self.request.user if self.request.user.is_authenticated else None)
try:
return HttpResponseRedirect('%s?ticket=%s&email=%s&key=%s' % (
reverse('helpdesk:public_view'),

View File

@ -12,4 +12,6 @@ pytz
six
djangorestframework
django-model-utils
pinax-teams @ git+https://github.com/auto-mat/pinax-teams.git@slugify#egg=pinax-teams
# specific commit because the current release has no required library upgrade
pinax-teams @ git+https://github.com/pinax/pinax-teams.git@dd75e1c#egg=pinax-teams