mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 03:17:07 +00:00
feat(people): Add notice to fill in user details
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -18,3 +18,4 @@ deployment-key.pub
|
||||
# Deployment
|
||||
.vagrant/
|
||||
staging.yml
|
||||
/.dbbackup/
|
||||
|
||||
@@ -127,6 +127,17 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if request.user.is_authenticated and not request.user.has_person %}
|
||||
<div class="alert alert-info rounded-0" role="alert">
|
||||
<p class="text-center mb-0">
|
||||
Your profile is currently blank. Please fill in your details so you can be part of the network.
|
||||
|
||||
<a class="btn btn-success"
|
||||
href="{% url 'people:person.create' %}?user">Profile</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% block before_content %}{% endblock %}
|
||||
|
||||
<main class="container">
|
||||
|
||||
@@ -15,6 +15,16 @@ class User(AbstractUser):
|
||||
"""
|
||||
Custom user model in case we need to make changes later.
|
||||
"""
|
||||
def has_person(self) -> bool:
|
||||
"""
|
||||
Does this user have a linked :class:`Person` record?
|
||||
"""
|
||||
try:
|
||||
person = self.person
|
||||
return True
|
||||
|
||||
except Person.DoesNotExist:
|
||||
return False
|
||||
|
||||
|
||||
class Organisation(models.Model):
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
<a class="btn btn-success"
|
||||
href="{% url 'people:person.update' pk=person.pk %}">Update</a>
|
||||
|
||||
<a class="btn btn-info"
|
||||
href="{% url 'password_change' %}?next={{ person.get_absolute_url }}">Change Password</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user