-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #656 from kartoza/develop
Version 4.4.6 (#651)
- Loading branch information
Showing
15 changed files
with
273 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule gwml2
updated
from e80241 to 40746e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 3.2.20 on 2024-02-23 06:10 | ||
|
||
import datetime | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('igrac', '0010_alter_groundwaterlayer_options'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='RegistrationPage', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('code', models.TextField(max_length=16, unique=True)), | ||
('created_at', models.DateTimeField(blank=True, default=datetime.datetime.now)), | ||
('note', models.TextField(blank=True, null=True)), | ||
('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"""Registration page that needs to be used for register.""" | ||
|
||
import random | ||
import string | ||
from datetime import datetime | ||
|
||
from django.contrib.auth import get_user_model | ||
from django.db import models | ||
|
||
User = get_user_model() | ||
|
||
|
||
def id_generator( | ||
size=36, | ||
chars=string.ascii_letters + string.digits + '+_-' | ||
): | ||
"""ID Generator.""" | ||
return ''.join(random.choice(chars) for _ in range(size)) | ||
|
||
|
||
class RegistrationPage(models.Model): | ||
"""Registration page that has random uuid. | ||
User can just register through this model. | ||
When user is created through this page, it will be invalid | ||
and need to create new one. | ||
""" | ||
|
||
user = models.OneToOneField( | ||
User, on_delete=models.SET_NULL, | ||
blank=True, null=True | ||
) | ||
code = models.TextField(max_length=16, unique=True) | ||
created_at = models.DateTimeField( | ||
default=datetime.now, blank=True | ||
) | ||
note = models.TextField( | ||
blank=True, null=True | ||
) | ||
|
||
def __str__(self): | ||
return str(self.code) | ||
|
||
def save(self, *args, **kwargs): | ||
"""Save model.""" | ||
if not self.code: | ||
self.code = id_generator() | ||
return super().save(*args, **kwargs) |
24 changes: 24 additions & 0 deletions
24
django_project/igrac/templates/account/signup-not-found.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% load static %} | ||
{% load bootstrap_tags %} | ||
{% load igrac_bootstrap_tags %} | ||
|
||
{% block page_title %} | ||
<h1>Download Form.</h1> | ||
{% endblock page_title %} | ||
|
||
{% block extra_head %} | ||
{% endblock %} | ||
|
||
{% block body_outer %} | ||
<div class="page-header"> | ||
<h1>Registration page is not found</h1> | ||
</div> | ||
<div class="row"> | ||
Registration is only for data providers. It is not required to access and download the resources available in the GGIS. If you are from a partner organization and you have data that could be shared in the GGIS, please reach out to the website administrator: <a href="mailto:ggis@un-igrac.org">ggis@un-igrac.org</a> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block extra_script %} | ||
{% endblock %} |
24 changes: 24 additions & 0 deletions
24
django_project/igrac/templates/account/signup-not-valid.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% load static %} | ||
{% load bootstrap_tags %} | ||
{% load igrac_bootstrap_tags %} | ||
|
||
{% block page_title %} | ||
<h1>Download Form.</h1> | ||
{% endblock page_title %} | ||
|
||
{% block extra_head %} | ||
{% endblock %} | ||
|
||
{% block body_outer %} | ||
<div class="page-header"> | ||
<h1>Registration page is not valid</h1> | ||
</div> | ||
<div class="row"> | ||
Please request a valid registration link to the website administrator: <a href="mailto:ggis@un-igrac.org">ggis@un-igrac.org</a>. | ||
</div> | ||
{% endblock %} | ||
|
||
{% block extra_script %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.