resolve conflicts

This commit is contained in:
Cayo Puigdefabregas 2024-01-17 11:30:56 +01:00
commit 7a9017563a
7 changed files with 14 additions and 10 deletions

Binary file not shown.

Binary file not shown.

View File

@ -79,7 +79,8 @@ class ImportForm(forms.Form):
if File_datas.objects.filter(file_name=self.file_name, success=True).exists():
raise ValidationError("This file already exists!")
df = pd.read_csv (data, delimiter="\t", quotechar='"', quoting=csv.QUOTE_ALL)
# df = pd.read_csv (data, delimiter="\t", quotechar='"', quoting=csv.QUOTE_ALL)
df = pd.read_excel(data)
data_pd = df.fillna('').to_dict()
if not data_pd:

View File

@ -549,8 +549,12 @@ class VerificableCredential(models.Model):
format = "%Y-%m-%dT%H:%M:%SZ"
issuance_date = self.issued_on.strftime(format)
url_id = "{}/credentials/{}".format(
settings.DOMAIN.strip("/"),
self.id
)
context = {
'vc_id': self.id,
'vc_id': url_id,
'issuer_did': self.issuer_did.did,
'subject_did': self.subject_did and self.subject_did.did or '',
'issuance_date': issuance_date,

View File

@ -4,8 +4,6 @@
{% block login_content %}
<form action="{% url 'idhub:login' %}" role="form" method="post">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}" />
<div id="div_id_username"
class="clearfix control-group {% if form.username.errors %}error{% endif %}">
<div class="form-group">

View File

@ -14,8 +14,10 @@ class LoginView(auth_views.LoginView):
}
def get(self, request, *args, **kwargs):
if request.GET.get('next'):
self.extra_context['success_url'] = request.GET.get('next')
self.extra_context['success_url'] = request.GET.get(
'next',
reverse_lazy('idhub:user_dashboard')
)
return super().get(request, *args, **kwargs)
def form_valid(self, form):
@ -26,11 +28,8 @@ class LoginView(auth_views.LoginView):
sensitive_data_encryption_key = user.decrypt_sensitive_data(password)
if not user.is_anonymous and user.is_admin:
user_dashboard = reverse_lazy('idhub:user_dashboard')
admin_dashboard = reverse_lazy('idhub:admin_dashboard')
if self.extra_context['success_url'] == user_dashboard:
self.extra_context['success_url'] = admin_dashboard
self.extra_context['success_url'] = admin_dashboard
cache.set("KEY_DIDS", sensitive_data_encryption_key, None)
self.request.session["key_did"] = user.encrypt_data(

View File

@ -6,6 +6,8 @@ black==23.9.1
python-decouple==3.8
jsonschema==4.19.1
pandas==2.1.1
xlrd==2.0.1
odfpy==1.4.1
requests==2.31.0
didkit==0.3.2
jinja2==3.1.2