Browse Source

bugfixFDB completed

master
corsaronero 1 year ago
parent
commit
a72d9de3dd
6 changed files with 91 additions and 5 deletions
  1. +1
    -0
      .gitignore
  2. +34
    -0
      input/logfile
  3. +4
    -4
      input/settings.py
  4. +23
    -0
      input/templates/input/if_mail.html
  5. +22
    -0
      input/templates/input/if_mail.txt
  6. +7
    -1
      input/views.py

+ 1
- 0
.gitignore View File

@ -3,6 +3,7 @@
/staticfiles /staticfiles
# /foerderbarometer/settings.py # /foerderbarometer/settings.py
/foerderbarometer/*settings* /foerderbarometer/*settings*
/foerderbarometer/input/settings.py
/nohup.out /nohup.out
/logfile /logfile
*~ *~

+ 34
- 0
input/logfile View File

@ -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 "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", 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.

+ 4
- 4
input/settings.py View File

@ -1,9 +1,9 @@
# mail for IF-OTRS # 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 = '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 # prefix for urls
SURVEYPREFIX = 'https://wikimedia.sslsurvey.de/Foerderbarometer/?' SURVEYPREFIX = 'https://wikimedia.sslsurvey.de/Foerderbarometer/?'

+ 23
- 0
input/templates/input/if_mail.html View File

@ -25,6 +25,29 @@ Persönliche Daten: {{data.data}}
Variante: {{data.variant}}<br> Variante: {{data.variant}}<br>
Sendungsadrese: {{data.send_to}} <br> {% endif %} Sendungsadrese: {{data.send_to}} <br> {% endif %}
<br><br> <br><br>
Zum Eintrag in der Förderdatenbank:
{% if data.choice == 'BIB' %}
<a href="{{data.urlprefix}}/admin/input/library/{{data.pk}}/change">{{data.urlprefix}}/admin/input/library/{{data.pk}}/change</a>
{% elif data.choice == 'ELIT'%}
<a href="{{data.urlprefix}}/admin/input/library/{{data.pk}}/change">{{data.urlprefix}}/admin/input/library/{{data.pk}}/change</a>
{% elif data.choice == 'LIT'%}
<a href="{{data.urlprefix}}/admin/input/literature/{{data.pk}}/change">{{data.urlprefix}}/admin/input/literature/{{data.pk}}/change</a>
{% elif data.choice == 'MAIL'%}
<a href="{{data.urlprefix}}/admin/input/email/{{data.pk}}/change">{{data.urlprefix}}/admin/input/email/{{data.pk}}/change</a>
{% elif data.choice == 'IFG'%}
<a href="{{data.urlprefix}}/admin/input/ifg/{{data.pk}}/change">{{data.urlprefix}}/admin/input/ifg/{{data.pk}}/change</a>
{% elif data.choice == 'LIST'%}
<a href="{{data.urlprefix}}/admin/input/list/{{data.pk}}/change">{{data.urlprefix}}/admin/input/list/{{data.pk}}/change</a>
{% elif data.choice == 'TRAV'%}
<a href="{{data.urlprefix}}/admin/input/travel/{{data.pk}}/change">{{data.urlprefix}}/admin/input/travel/{{data.pk}}/change</a>
{% elif data.choice == 'SOFT'%}
<a href="{{data.urlprefix}}/admin/input/library/{{data.pk}}/change">{{data.urlprefix}}/admin/input/library/{{data.pk}}/change</a>
{% elif data.choice == 'VIS'%}
<a href="{{data.urlprefix}}/admin/input/businesscard/{{data.pk}}/change">{{data.urlprefix}}/admin/input/businesscard/{{data.pk}}/change</a>
{% endif %}
<br><br>
Zum Genehmigen hier klicken: <a href="{{data.urlprefix}}{% url 'authorize' data.choice data.pk %}">{{data.urlprefix}}{% url 'authorize' data.choice data.pk %}</a> Zum Genehmigen hier klicken: <a href="{{data.urlprefix}}{% url 'authorize' data.choice data.pk %}">{{data.urlprefix}}{% url 'authorize' data.choice data.pk %}</a>
<br><br> <br><br>
Zu Ablehnen hier klicken: <a href="{{data.urlprefix}}{% url 'deny' data.choice data.pk %}">{{data.urlprefix}}{% url 'deny' data.choice data.pk %}</a> Zu Ablehnen hier klicken: <a href="{{data.urlprefix}}{% url 'deny' data.choice data.pk %}">{{data.urlprefix}}{% url 'deny' data.choice data.pk %}</a>

+ 22
- 0
input/templates/input/if_mail.txt View File

@ -23,6 +23,28 @@ Persönliche Daten: {{data.data}}
Variante: {{data.variant}} Variante: {{data.variant}}
Sendungsadrese: {{data.send_to}} {% endif %} Sendungsadrese: {{data.send_to}} {% endif %}
Zum Eintrag in der Förderdatenbank:
{% if data.choice == 'BIB' %}
<a href="{{data.urlprefix}}/admin/input/library/{{data.pk}}/change">{{data.urlprefix}}/admin/input/library/{{data.pk}}/change</a>
{% elif data.choice == 'ELIT'%}
<a href="{{data.urlprefix}}/admin/input/library/{{data.pk}}/change">{{data.urlprefix}}/admin/input/library/{{data.pk}}/change</a>
{% elif data.choice == 'LIT'%}
<a href="{{data.urlprefix}}/admin/input/literature/{{data.pk}}/change">{{data.urlprefix}}/admin/input/literature/{{data.pk}}/change</a>
{% elif data.choice == 'MAIL'%}
<a href="{{data.urlprefix}}/admin/input/email/{{data.pk}}/change">{{data.urlprefix}}/admin/input/email/{{data.pk}}/change</a>
{% elif data.choice == 'IFG'%}
<a href="{{data.urlprefix}}/admin/input/ifg/{{data.pk}}/change">{{data.urlprefix}}/admin/input/ifg/{{data.pk}}/change</a>
{% elif data.choice == 'LIST'%}
<a href="{{data.urlprefix}}/admin/input/list/{{data.pk}}/change">{{data.urlprefix}}/admin/input/list/{{data.pk}}/change</a>
{% elif data.choice == 'TRAV'%}
<a href="{{data.urlprefix}}/admin/input/travel/{{data.pk}}/change">{{data.urlprefix}}/admin/input/travel/{{data.pk}}/change</a>
{% elif data.choice == 'SOFT'%}
<a href="{{data.urlprefix}}/admin/input/library/{{data.pk}}/change">{{data.urlprefix}}/admin/input/library/{{data.pk}}/change</a>
{% elif data.choice == 'VIS'%}
<a href="{{data.urlprefix}}/admin/input/businesscard/{{data.pk}}/change">{{data.urlprefix}}/admin/input/businesscard/{{data.pk}}/change</a>
{% endif %}
Zum Genehmigen hier klicken: {{data.urlprefix}}{% url 'authorize' data.choice data.pk %} Zum Genehmigen hier klicken: {{data.urlprefix}}{% url 'authorize' data.choice data.pk %}
Zu Ablehnen hier klicken: {{data.urlprefix}}{% url 'deny' data.choice data.pk %} Zu Ablehnen hier klicken: {{data.urlprefix}}{% url 'deny' data.choice data.pk %}

+ 7
- 1
input/views.py View File

@ -17,7 +17,7 @@ from django.utils.translation import gettext as _
from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\ from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\
HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\ HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\
ListForm, BusinessCardForm, INTERN_CHOICES 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 from .settings import IF_EMAIL
def auth_deny(choice,pk,auth): def auth_deny(choice,pk,auth):
@ -29,6 +29,12 @@ def auth_deny(choice,pk,auth):
IFG.set_granted(pk,auth) IFG.set_granted(pk,auth)
elif choice == 'TRAV': elif choice == 'TRAV':
Travel.set_granted(pk,auth) 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: else:
return HttpResponse(f'ERROR! UNKNOWN CHOICE TYPE! {choice}') return HttpResponse(f'ERROR! UNKNOWN CHOICE TYPE! {choice}')
return False return False

Loading…
Cancel
Save