diff --git a/amadeus/templates/base.html b/amadeus/templates/base.html index 92e4730..6df7b2c 100644 --- a/amadeus/templates/base.html +++ b/amadeus/templates/base.html @@ -119,7 +119,7 @@
  • {% trans 'Profile' %}
  • {% trans 'Edit Profile' %}
  • {% trans 'Change Password' %}
  • -
  • {% trans 'Delete Account' %}
  • +
  • {% trans 'Delete Account' %}
  • diff --git a/users/models.py b/users/models.py index c540c64..d0cf415 100644 --- a/users/models.py +++ b/users/models.py @@ -70,3 +70,15 @@ class User(AbstractBaseUser, PermissionsMixin): def is_student(self): return _('Is not a student') + + def has_dependencies(self): + if self.is_staff: + return True + + #Check if is coordinator of something + + #Check if is professor of something + + #Check if is student of something + + return False diff --git a/users/templates/users/delete.html b/users/templates/users/delete.html new file mode 100644 index 0000000..30a5b92 --- /dev/null +++ b/users/templates/users/delete.html @@ -0,0 +1,35 @@ +{% extends 'users/list.html' %} + +{% load static i18n %} +{% load widget_tweaks %} +{% load django_bootstrap_breadcrumbs %} + +{% block breadcrumbs %} + {{ block.super }} + {% breadcrumb 'Delete User' 'users:delete' %} +{% endblock %} + +{% block content %} +
    +
    +
    +
    + {% csrf_token %} +

    {% trans 'Are you sure you want delete the user' %}: {{ acc }}?

    +

    {% trans 'All data will be lost and havent how recover it.' %}

    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +{% endblock %} diff --git a/users/templates/users/delete_account.html b/users/templates/users/delete_account.html new file mode 100644 index 0000000..4ebf986 --- /dev/null +++ b/users/templates/users/delete_account.html @@ -0,0 +1,35 @@ +{% extends 'users/profile.html' %} + +{% load static i18n %} +{% load widget_tweaks %} +{% load django_bootstrap_breadcrumbs %} + +{% block breadcrumbs %} + {{ block.super }} + {% breadcrumb 'Remove Account' 'users:remove_acc' %} +{% endblock %} + +{% block content %} +
    +
    +
    +
    + {% csrf_token %} +

    {% trans 'Are you sure you want delete your account?' %}

    +

    {% trans 'All data will be lost and havent how recover it.' %}

    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +{% endblock %} diff --git a/users/templates/users/list.html b/users/templates/users/list.html index 7832735..0d4d385 100644 --- a/users/templates/users/list.html +++ b/users/templates/users/list.html @@ -63,7 +63,7 @@
    {% trans 'Edit' %} - {% trans 'Delete' %} + {% trans 'Delete' %}
    diff --git a/users/templates/users/profile.html b/users/templates/users/profile.html index 1d39726..21c4521 100644 --- a/users/templates/users/profile.html +++ b/users/templates/users/profile.html @@ -16,7 +16,7 @@ {% block content %} {% if messages %} {% for message in messages %} -