|
|
@@ -52,8 +52,9 @@ def welcome(request):
|
|
|
return HttpResponseRedirect(reverse('azienda:welcome'))
|
|
|
|
|
|
print("sceltaazienda = ",request.POST.get('sceltaazienda'))
|
|
|
- if sceltaazienda == 0: #richiesta una nuova azienda
|
|
|
- data['AziendaId']=None
|
|
|
+ if sceltaazienda < 1 : #richiesta una nuova azienda
|
|
|
+ if 'AziendaId' in data:
|
|
|
+ data['AziendaId'] = none
|
|
|
return HttpResponseRedirect(reverse('azienda:edit'))
|
|
|
else:
|
|
|
azienda = Azienda.objects.get(pk=sceltaazienda)
|
|
|
@@ -103,6 +104,7 @@ def edit(request):
|
|
|
data['HeaderTitle'] = getConfig('HeaderTitle')
|
|
|
user = data['admin'] = User.objects.get(pk=AdminId)
|
|
|
|
|
|
+ azienda = None
|
|
|
if 'AziendaId' in request.session:
|
|
|
print('trovato riferimento AziendaId',request.session.get('AziendaId'))
|
|
|
azid = request.session.get('AziendaId')
|