From fc0414a286fe101be7e2e0551c676878d99c245e Mon Sep 17 00:00:00 2001 From: alpcentaur Date: Mon, 27 Feb 2023 17:09:29 +0000 Subject: [PATCH] bugfixFDB completed --- .gitignore | 1 + input/logfile | 34 ++++++++++++++++++++++++++++++ input/settings.py | 8 +++---- input/templates/input/if_mail.html | 23 ++++++++++++++++++++ input/templates/input/if_mail.txt | 22 +++++++++++++++++++ input/views.py | 8 ++++++- 6 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 input/logfile diff --git a/.gitignore b/.gitignore index 1139068..f041b72 100755 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /staticfiles # /foerderbarometer/settings.py /foerderbarometer/*settings* +/foerderbarometer/input/settings.py /nohup.out /logfile *~ diff --git a/input/logfile b/input/logfile new file mode 100644 index 0000000..5f53927 --- /dev/null +++ b/input/logfile @@ -0,0 +1,34 @@ +nohup: ignoring input +[2023-02-07 12:36:29 +0000] [2449] [INFO] Starting gunicorn 20.1.0 +[2023-02-07 12:36:29 +0000] [2449] [INFO] Listening at: http://0.0.0.0:8000 (2449) +[2023-02-07 12:36:29 +0000] [2449] [INFO] Using worker: sync +[2023-02-07 12:36:29 +0000] [2450] [INFO] Booting worker with pid: 2450 +[2023-02-07 12:36:29 +0000] [2450] [ERROR] Exception in worker process +Traceback (most recent call last): + File "/home/alpcentaur/ProjektA/wikimedia/wmdeit_foerderbarometer/foerderbarometer/venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker + worker.init_process() + File "/home/alpcentaur/ProjektA/wikimedia/wmdeit_foerderbarometer/foerderbarometer/venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process + self.load_wsgi() + File "/home/alpcentaur/ProjektA/wikimedia/wmdeit_foerderbarometer/foerderbarometer/venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi + self.wsgi = self.app.wsgi() + File "/home/alpcentaur/ProjektA/wikimedia/wmdeit_foerderbarometer/foerderbarometer/venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi + self.callable = self.load() + File "/home/alpcentaur/ProjektA/wikimedia/wmdeit_foerderbarometer/foerderbarometer/venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load + return self.load_wsgiapp() + File "/home/alpcentaur/ProjektA/wikimedia/wmdeit_foerderbarometer/foerderbarometer/venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp + return util.import_app(self.app_uri) + File "/home/alpcentaur/ProjektA/wikimedia/wmdeit_foerderbarometer/foerderbarometer/venv/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app + mod = importlib.import_module(module) + File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module + return _bootstrap._gcd_import(name[level:], package, level) + File "", line 1050, in _gcd_import + File "", line 1027, in _find_and_load + File "", line 992, in _find_and_load_unlocked + File "", line 241, in _call_with_frames_removed + File "", line 1050, in _gcd_import + File "", line 1027, in _find_and_load + File "", line 1004, in _find_and_load_unlocked +ModuleNotFoundError: No module named 'foerderbarometer' +[2023-02-07 12:36:29 +0000] [2450] [INFO] Worker exiting (pid: 2450) +[2023-02-07 12:36:29 +0000] [2449] [INFO] Shutting down: Master +[2023-02-07 12:36:29 +0000] [2449] [INFO] Reason: Worker failed to boot. diff --git a/input/settings.py b/input/settings.py index 3b43e9a..e1ba53e 100755 --- a/input/settings.py +++ b/input/settings.py @@ -1,9 +1,9 @@ # mail for IF-OTRS -IF_EMAIL = 'community@wikimedia.de' -#IF_EMAIL = 'test-luca-ext@wikimedia.de' +#IF_EMAIL = 'community@wikimedia.de' +IF_EMAIL = 'test-luca-ext@wikimedia.de' #SURVEY_EMAIL = 'christof.pins@wikimedia.de' -#SURVEY_EMAIL = 'luca.wulf@cannabinieri.de' -SURVEY_EMAIL = 'sandro.halank@wikimedia.de' +SURVEY_EMAIL = 'luca.wulf@cannabinieri.de' +#SURVEY_EMAIL = 'sandro.halank@wikimedia.de' # prefix for urls SURVEYPREFIX = 'https://wikimedia.sslsurvey.de/Foerderbarometer/?' diff --git a/input/templates/input/if_mail.html b/input/templates/input/if_mail.html index d130016..efd2941 100755 --- a/input/templates/input/if_mail.html +++ b/input/templates/input/if_mail.html @@ -25,6 +25,29 @@ Persönliche Daten: {{data.data}}
Variante: {{data.variant}}
Sendungsadrese: {{data.send_to}}
{% endif %}

+ +Zum Eintrag in der Förderdatenbank: +{% if data.choice == 'BIB' %} +{{data.urlprefix}}/admin/input/library/{{data.pk}}/change +{% elif data.choice == 'ELIT'%} +{{data.urlprefix}}/admin/input/library/{{data.pk}}/change +{% elif data.choice == 'LIT'%} +{{data.urlprefix}}/admin/input/literature/{{data.pk}}/change +{% elif data.choice == 'MAIL'%} +{{data.urlprefix}}/admin/input/email/{{data.pk}}/change +{% elif data.choice == 'IFG'%} +{{data.urlprefix}}/admin/input/ifg/{{data.pk}}/change +{% elif data.choice == 'LIST'%} +{{data.urlprefix}}/admin/input/list/{{data.pk}}/change +{% elif data.choice == 'TRAV'%} +{{data.urlprefix}}/admin/input/travel/{{data.pk}}/change +{% elif data.choice == 'SOFT'%} +{{data.urlprefix}}/admin/input/library/{{data.pk}}/change +{% elif data.choice == 'VIS'%} +{{data.urlprefix}}/admin/input/businesscard/{{data.pk}}/change +{% endif %} +

+ Zum Genehmigen hier klicken: {{data.urlprefix}}{% url 'authorize' data.choice data.pk %}

Zu Ablehnen hier klicken: {{data.urlprefix}}{% url 'deny' data.choice data.pk %} diff --git a/input/templates/input/if_mail.txt b/input/templates/input/if_mail.txt index d3cfd04..4cb0375 100755 --- a/input/templates/input/if_mail.txt +++ b/input/templates/input/if_mail.txt @@ -23,6 +23,28 @@ Persönliche Daten: {{data.data}} Variante: {{data.variant}} Sendungsadrese: {{data.send_to}} {% endif %} +Zum Eintrag in der Förderdatenbank: +{% if data.choice == 'BIB' %} +{{data.urlprefix}}/admin/input/library/{{data.pk}}/change +{% elif data.choice == 'ELIT'%} +{{data.urlprefix}}/admin/input/library/{{data.pk}}/change +{% elif data.choice == 'LIT'%} +{{data.urlprefix}}/admin/input/literature/{{data.pk}}/change +{% elif data.choice == 'MAIL'%} +{{data.urlprefix}}/admin/input/email/{{data.pk}}/change +{% elif data.choice == 'IFG'%} +{{data.urlprefix}}/admin/input/ifg/{{data.pk}}/change +{% elif data.choice == 'LIST'%} +{{data.urlprefix}}/admin/input/list/{{data.pk}}/change +{% elif data.choice == 'TRAV'%} +{{data.urlprefix}}/admin/input/travel/{{data.pk}}/change +{% elif data.choice == 'SOFT'%} +{{data.urlprefix}}/admin/input/library/{{data.pk}}/change +{% elif data.choice == 'VIS'%} +{{data.urlprefix}}/admin/input/businesscard/{{data.pk}}/change +{% endif %} + + Zum Genehmigen hier klicken: {{data.urlprefix}}{% url 'authorize' data.choice data.pk %} Zu Ablehnen hier klicken: {{data.urlprefix}}{% url 'deny' data.choice data.pk %} diff --git a/input/views.py b/input/views.py index 203de7a..8a3df6f 100755 --- a/input/views.py +++ b/input/views.py @@ -17,7 +17,7 @@ from django.utils.translation import gettext as _ from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\ HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\ ListForm, BusinessCardForm, INTERN_CHOICES -from .models import Project, TYPE_CHOICES, Library, Literature, Travel +from .models import Project, TYPE_CHOICES, Library, Literature, Travel, IFG, BusinessCard, Email, List from .settings import IF_EMAIL def auth_deny(choice,pk,auth): @@ -29,6 +29,12 @@ def auth_deny(choice,pk,auth): IFG.set_granted(pk,auth) elif choice == 'TRAV': Travel.set_granted(pk,auth) + elif choice == 'VIS': + BusinessCard.set_granted(pk,auth) + elif choice == 'MAIL': + Email.set_granted(pk,auth) + elif choice == 'LIST': + List.set_granted(pk,auth) else: return HttpResponse(f'ERROR! UNKNOWN CHOICE TYPE! {choice}') return False