From 19682de806b9a340b864d1b0738d4f23f6bd2a24 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 11 Apr 2023 17:30:29 +0200 Subject: [PATCH] Make names in community auth unique Technically not needed for the system, but confusion is ensured if you have two different sites with the same name... --- .../migrations/0009_cauth_unique_names.py | 23 +++++++++++ pgweb/account/models.py | 4 +- templates/docs/release_notes_list.html | 40 +++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 pgweb/account/migrations/0009_cauth_unique_names.py create mode 100644 templates/docs/release_notes_list.html diff --git a/pgweb/account/migrations/0009_cauth_unique_names.py b/pgweb/account/migrations/0009_cauth_unique_names.py new file mode 100644 index 00000000..9c77bc20 --- /dev/null +++ b/pgweb/account/migrations/0009_cauth_unique_names.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.14 on 2023-04-11 15:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0008_cooloff_message'), + ] + + operations = [ + migrations.AlterField( + model_name='communityauthorg', + name='orgname', + field=models.CharField(help_text='Name of the organisation', max_length=100, unique=True), + ), + migrations.AlterField( + model_name='communityauthsite', + name='name', + field=models.CharField(help_text="Note that the value in this field is shown on the login page, so make sure it's user-friendly!", max_length=100, unique=True), + ), + ] diff --git a/pgweb/account/models.py b/pgweb/account/models.py index 0244a27e..e3fa5fec 100644 --- a/pgweb/account/models.py +++ b/pgweb/account/models.py @@ -3,7 +3,7 @@ from django.contrib.auth.models import User class CommunityAuthOrg(models.Model): - orgname = models.CharField(max_length=100, null=False, blank=False, + orgname = models.CharField(max_length=100, null=False, blank=False, unique=True, help_text="Name of the organisation") require_consent = models.BooleanField(null=False, blank=False, default=True) @@ -12,7 +12,7 @@ class CommunityAuthOrg(models.Model): class CommunityAuthSite(models.Model): - name = models.CharField(max_length=100, null=False, blank=False, + name = models.CharField(max_length=100, null=False, blank=False, unique=True, help_text="Note that the value in this field is shown on the login page, so make sure it's user-friendly!") redirecturl = models.URLField(max_length=200, null=False, blank=False) apiurl = models.URLField(max_length=200, null=False, blank=True) diff --git a/templates/docs/release_notes_list.html b/templates/docs/release_notes_list.html new file mode 100644 index 00000000..6cdb98c5 --- /dev/null +++ b/templates/docs/release_notes_list.html @@ -0,0 +1,40 @@ +{% extends "base/page.html" %} +{% load pgfilters %} + +{%block title%}Release Notes{%endblock%} + +{% block contents %} +{% regroup releases by major as release_groups %} + +
+
+
+

Release Notes

+
+

Below is the complete archive of release notes for every version of PostgreSQL.

+ +
+
+ +{% endblock %} -- 2.39.5