diff --git a/petitions/views.py b/petitions/views.py index 86c527ccc405f6270909f55622607d7cfff08f70..662dc0774df2d0f75b77760951480c9522eafdc0 100644 --- a/petitions/views.py +++ b/petitions/views.py @@ -20,14 +20,17 @@ def petition(request, slug): if request.user.is_authenticated: is_signed = petition.petition_signatories.verified().filter( signatory=request.user.contributor).exists() + affiliation = request.user.contributor.affiliations.first() or {} + institition = affiliation.institution.name if affiliation else '' + country = affiliation.institution.country if affiliation else '' initial = { 'petition': petition, 'title': request.user.contributor.title, 'first_name': request.user.first_name, 'last_name': request.user.last_name, 'email': request.user.email, - 'country_of_employment': request.user.contributor.affiliation.country_of_employment, - 'affiliation': request.user.contributor.affiliation.name, + 'country_of_employment': country, + 'affiliation': institition, } form = SignPetitionForm(request.POST or None, initial=initial, petition=petition, diff --git a/templates/500.html b/templates/500.html index 91403510f7c56414f89d263243fe1c4bbebce003..fea9d3baa473f2a2d2bda5ccd4cc497e8f613646 100644 --- a/templates/500.html +++ b/templates/500.html @@ -6,9 +6,9 @@ <div style="text-align: center;"> <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> - <h1>The server responded with an error.</h1> + <h1>We are sorry, something went wrong.</h1> <h2>500</h2> - <h3>We are sorry, something went wrong. The SciPost administrators have been informed.</h3> + <h3>The SciPost administrators have been informed.</h3> <p style="margin-top: 20px;">Go back to <a href="//scipost.org">the homepage</a>.</p> </div>