diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2021-04-08 14:19:54 -0400 |
---|---|---|
committer | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2021-04-08 14:23:21 -0400 |
commit | e4488315862998d198d69cd8e4649428276e4f82 (patch) | |
tree | d64ab79bc351e98b135cdc6ffc7674a1ce6335aa /src/account | |
parent | 01167232628eab74d3c4be44345dd3798da81135 (diff) |
Squashed commit of the following:
commit 4f12ae24d0de22f526d6dd59dbc437bdaa1874f1
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Wed Apr 7 15:16:29 2021 -0400
Check if hostname null in resource filter
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: Ie28c83109faf529f0a3bd4c61b1f96e064c1577c
commit e9ed42e7ace16f36532a23d360300bb7f6b0387e
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Wed Apr 7 13:15:08 2021 -0400
Fix typo for image disable
Change-Id: I74314aba4d1ee6f89b450666fd76deabdd99c11d
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
commit 593ea6dc98ab12c1e70d65b16103f92f8b17abbc
Merge: 241ff30 2271036
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Apr 7 15:20:07 2021 +0000
Merge "Restrict image on multi-node booking"
commit 2271036232bce7ce4f2136ee6e031e9e77d9c1c2
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Tue Apr 6 16:18:36 2021 -0400
Restrict image on multi-node booking
Change-Id: I280dba83bceed74195a77b28f3016421c462cc5a
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
commit 241ff304980c8bf542fdd1a2a47f73accf912ee1
Merge: f145622 d007fa6
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Tue Apr 6 17:38:49 2021 +0000
Merge "Remove exposure of users on dashboard"
commit f1456220fcc098cb0f5e9fc60124680ff8aba6af
Merge: 6366b17 3abc7dc
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Tue Mar 30 18:01:05 2021 +0000
Merge "Hostname not required"
commit 6366b1776bc51c29d4ba4c256f51d16acc52d871
Merge: a35c01b 0573f51
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Tue Mar 30 17:54:21 2021 +0000
Merge "Update actions to free hosts and vlans"
commit d007fa661e2faf77e70cb75c8d520941e907ebf7
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Wed Mar 24 17:22:54 2021 -0400
Remove exposure of users on dashboard
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I83b93d9247a7eafb54e4a5761d1423a504d86400
commit 3abc7dcc9603cf978e5b7c2762e80998a4a6eef5
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Mon Mar 29 15:00:52 2021 -0400
Hostname not required
Change-Id: I7d639a17452e426e92671c558b111d6bcec34e8c
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
commit a35c01bccec1137ccd8a0f07f832daecb4ee2da3
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Mon Mar 29 14:14:48 2021 -0400
Resource display remains on error
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I0a59ef9da908599cf75e379b68b33e280a4deb16
commit 7addb00710a5865a9e6bc38f1d826aa0323ee67e
Merge: f6472a3 f6753ae
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Mon Mar 29 18:05:56 2021 +0000
Merge "Fixes error on installer fail"
commit f6472a3cca58ca428200265acf720174ed36ea7e
Merge: 2e9a8c8 e3dec82
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Fri Mar 26 23:26:33 2021 +0000
Merge "Remove duplicate migration"
commit 2e9a8c854a93705d080dc54b8c6e3ba36eaba366
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Thu Mar 25 15:16:50 2021 -0400
Additional fix for email
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I0599e29c7930386651f77bceccf05d069ebd4101
commit f6753ae2c5f54fb79375214590e565218b1bf0d7
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Tue Sep 8 15:13:23 2020 -0400
Fixes error on installer fail
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I823f3c5dd2b7677b428b88e1af4bba78d7dc698c
commit e3dec8238442865939bed379aa25219103f4d287
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Wed Mar 24 16:09:15 2021 -0400
Remove duplicate migration
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I456b61f3ad25823dbcf2468b303c1e68ff41df7b
commit e0a5e206a3a68bbae373bf8f9257b5aba14932c5
Merge: e231274 8559820
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Mar 24 15:56:51 2021 +0000
Merge "Filters non working servers in quick booking"
commit e23127473b81bdbc1f4630036ddec3c46ee17dda
Merge: b14e617 e817c32
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Mar 24 15:48:39 2021 +0000
Merge "Front end fixes for enforcing hostname"
commit e817c3203fde0ca9bfb66a00919050cbdd1179e8
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Wed Feb 24 12:18:45 2021 -0500
Front end fixes for enforcing hostname
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I0a077307a2e1bcfef5b31acdaf4ecb73be64fff9
commit 0573f51f18c1e55fe162dbd5a3f9acbd5394e065
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Tue Feb 23 15:41:59 2021 -0500
Update actions to free hosts and vlans
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I94425ca5a48cccdf0b5382ef2bb16a989ee6b32d
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
commit b14e617edb86628f31648847c0b96206764ef44c
Merge: 13cdfee babedf3
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Tue Mar 23 18:34:16 2021 +0000
Merge "Added LF Edge template overrides."
commit babedf30038b453ea7d123c9bb744f4acb14e625
Author: Adam Hassick <ahassick@iol.unh.edu>
Date: Tue Mar 16 14:18:31 2021 -0400
Added LF Edge template overrides.
Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Change-Id: If119646eee67fb7e145c5e92e64fa4f28a947dbe
commit 13cdfee5d9656c2195bb6238d33d66cb637c22e4
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Mar 3 14:09:35 2021 -0500
Add copyright notice to admin_utils file
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I4b8a53371c0da274347dcfb7ea969ab4ce403f66
commit 72585921008fc89b5a32f4cb116d5ea9fe1a8ead
Merge: 8a902d3 de4cbcb
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Mar 17 17:07:40 2021 +0000
Merge "Add documentation to admin_utils functions"
commit de4cbcb7b770bd6ae14916715db361e987d1d3ec
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Mar 3 14:06:07 2021 -0500
Add documentation to admin_utils functions
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I27204f49513b3d646776261ed869d9f4d5c6fd64
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
commit 85598208ad7b65de9e4c60b509331a9b6ce46e52
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Mon Mar 8 17:15:42 2021 -0500
Filters non working servers in quick booking
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I47776a3e239a333d544d9e6e86f702b1d299baeb
commit 8a902d357fa6eca07384d25fac32a6e0521a63e5
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Mon Mar 8 16:21:56 2021 -0500
Release VLAN on booking end
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: Ib17fd871501a2af46bb78bbdfc68112a66e763c0
commit a320df5bf04978fc1e73a2e49d1a4bed5b82b849
Merge: 402e6e1 4caae41
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Mar 3 19:07:19 2021 +0000
Merge "Add documentation request functions and use hints to admin utils"
commit 4caae41287310cb1309c9b30e2871297d3ed21ef
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Wed Mar 3 12:10:02 2021 -0500
Add documentation request functions and use hints to admin utils
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I3211194fea5dc7d0c3569db6c1d42fe2f4aa53e1
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
commit 402e6e1111964f28235f6f7ec53ba51c76a8298f
Author: Sean Smith <ssmith@iol.unh.edu>
Date: Mon Feb 22 13:05:46 2021 -0500
Update celery schedule to send emails
Change-Id: I0fbf7080d440cea98d358a30ac5df88ce888a8a0
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Update celery
Change-Id: Icd20d67b561bacbccf1f9d75335f76ebdbef4f1d
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
commit db4c2dc4c4f0d86e0a00e8409eed74a0bcffb20b
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Mon Feb 8 11:42:41 2021 -0500
Add migration to set rconfig hostname to a valid linux hostname
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: Ib737dc25de37dd9d1c29a4e15f95da0fb68ddfc8
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
commit 9c200b5a15a336e3a3fc8d7ddac53053bc3b6ffe
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Tue Jan 19 12:38:32 2021 -0500
Add booking extension function to admin utils
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I4efab99e7cb82f69d01de8f74f30047263b4b0c2
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
commit c77b9169b09b7b53572b45a4f3679e602b8ca6a2
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Mon Jan 11 15:02:03 2021 -0500
Add server create function to admin utils
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I5776213bfc2eda310049c47dcb1fa1a601bd1896
commit 76b884730a00fecff5ed39d8ff4360941f313fe0
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Mon Jan 11 11:45:23 2021 -0500
Add scripts for creating default templates
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I522c617ff038531914f3a525b083d47c079489c1
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
commit d41310f9c3b62e8ab462fa94f2bf1b6b7d2b5e23
Merge: 107d8bb bf82270
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Mon Jan 4 21:15:58 2021 +0000
Merge "Fix issue where users are redirected to Jira login in LFID mode in certain cases"
commit bf822708949ad2e57b3966ad2bf485588fe4b29d
Author: Adam Hassick <ahassick@iol.unh.edu>
Date: Mon Jan 4 20:47:35 2021 +0000
Fix issue where users are redirected to Jira login in LFID mode in certain cases
Change-Id: If8a82d3a2628a7f55f902d321388be2419524c8b
Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Change-Id: Ieb9de968514b88a8c450967466d06c9860427d83
commit 107d8bb663083cd2e5fc09417ccd41560bc272c9
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Fri Dec 18 12:16:57 2020 -0500
Reduce log spam: deletion on resource bundles should be deprecated
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I6bffc393f7a6f93c4b8cd8d4c8bacba0c23fb256
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
commit 17388941fc3cff40cf2c7e7290e6bad9a27ca578
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Fri Dec 18 10:17:02 2020 -0500
Repair migration chain
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: Iaedcaf76111694bc7a3d8c44bd98f29d508610c5
commit c089784cc3b3708cf89f79962d62de66b009fc05
Author: Sawyer Bergeron <sbergeron@iol.unh.edu>
Date: Fri Dec 18 09:53:49 2020 -0500
Fix hostname default to be valid linux hostname
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I898c4e4a03261a1bf0f3f56dbc32104c9b5f3ee9
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: Ieb010345d5c44356db37f0d4df625686d143a81d
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/account')
-rw-r--r-- | src/account/forms.py | 5 | ||||
-rw-r--r-- | src/account/migrations/0007_userprofile_pulic_user.py | 18 | ||||
-rw-r--r-- | src/account/migrations/0008_auto_20210324_2106.py | 18 | ||||
-rw-r--r-- | src/account/migrations/0009_auto_20210324_2107.py | 18 | ||||
-rw-r--r-- | src/account/models.py | 4 | ||||
-rw-r--r-- | src/account/urls.py | 13 | ||||
-rw-r--r-- | src/account/views.py | 7 |
7 files changed, 78 insertions, 5 deletions
diff --git a/src/account/forms.py b/src/account/forms.py index dd1a0a9..28cb27d 100644 --- a/src/account/forms.py +++ b/src/account/forms.py @@ -18,11 +18,12 @@ from account.models import UserProfile class AccountSettingsForm(forms.ModelForm): class Meta: model = UserProfile - fields = ['company', 'email_addr', 'ssh_public_key', 'pgp_public_key', 'timezone'] + fields = ['company', 'email_addr', 'public_user', 'ssh_public_key', 'pgp_public_key', 'timezone'] labels = { 'email_addr': _('Email Address'), 'ssh_public_key': _('SSH Public Key'), - 'pgp_public_key': _('PGP Public Key') + 'pgp_public_key': _('PGP Public Key'), + 'public_user': _('Public User') } timezone = forms.ChoiceField(choices=[(x, x) for x in pytz.common_timezones], initial='UTC') diff --git a/src/account/migrations/0007_userprofile_pulic_user.py b/src/account/migrations/0007_userprofile_pulic_user.py new file mode 100644 index 0000000..6a229e6 --- /dev/null +++ b/src/account/migrations/0007_userprofile_pulic_user.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2 on 2021-03-24 21:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0006_auto_20201109_1947'), + ] + + operations = [ + migrations.AddField( + model_name='userprofile', + name='pulic_user', + field=models.BooleanField(default=False), + ), + ] diff --git a/src/account/migrations/0008_auto_20210324_2106.py b/src/account/migrations/0008_auto_20210324_2106.py new file mode 100644 index 0000000..9ff513d --- /dev/null +++ b/src/account/migrations/0008_auto_20210324_2106.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2 on 2021-03-24 21:06 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0007_userprofile_pulic_user'), + ] + + operations = [ + migrations.RenameField( + model_name='userprofile', + old_name='pulic_user', + new_name='public_user', + ), + ] diff --git a/src/account/migrations/0009_auto_20210324_2107.py b/src/account/migrations/0009_auto_20210324_2107.py new file mode 100644 index 0000000..baa7382 --- /dev/null +++ b/src/account/migrations/0009_auto_20210324_2107.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2 on 2021-03-24 21:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0008_auto_20210324_2106'), + ] + + operations = [ + migrations.AlterField( + model_name='userprofile', + name='public_user', + field=models.BooleanField(default=False), + ), + ] diff --git a/src/account/models.py b/src/account/models.py index 40de4d8..b71f0ac 100644 --- a/src/account/models.py +++ b/src/account/models.py @@ -54,6 +54,8 @@ class UserProfile(models.Model): full_name = models.CharField(max_length=100, null=True, blank=True, default='') booking_privledge = models.BooleanField(default=False) + public_user = models.BooleanField(default=False) + class Meta: db_table = 'user_profile' @@ -237,7 +239,7 @@ class Lab(models.Model): def get_available_resources(self): # Cannot import model normally due to ciruclar import Server = apps.get_model('resource_inventory', 'Server') # TODO: Find way to import ResourceQuery - resources = [str(resource.profile) for resource in Server.objects.filter(lab=self, booked=False)] + resources = [str(resource.profile) for resource in Server.objects.filter(lab=self, working=True, booked=False)] return dict(Counter(resources)) def __str__(self): diff --git a/src/account/urls.py b/src/account/urls.py index 0c01ee0..97d8c77 100644 --- a/src/account/urls.py +++ b/src/account/urls.py @@ -32,6 +32,7 @@ from account.views import ( AccountSettingsView, JiraAuthenticatedView, JiraLoginView, + OIDCLoginView, JiraLogoutView, UserListView, account_resource_view, @@ -45,11 +46,21 @@ from account.views import ( configuration_delete_view ) +from laas_dashboard import settings + + +def get_login_view(): + if (settings.AUTH_SETTING == 'LFID'): + return OIDCLoginView.as_view() + else: + return JiraLoginView.as_view() + + app_name = "account" urlpatterns = [ url(r'^settings/', AccountSettingsView.as_view(), name='settings'), url(r'^authenticated/$', JiraAuthenticatedView.as_view(), name='authenticated'), - url(r'^login/$', JiraLoginView.as_view(), name='login'), + url(r'^login/$', get_login_view(), name='login'), url(r'^logout/$', JiraLogoutView.as_view(), name='logout'), url(r'^users/$', UserListView.as_view(), name='users'), url(r'^my/resources/$', account_resource_view, name="my-resources"), diff --git a/src/account/views.py b/src/account/views.py index 08da918..b74126e 100644 --- a/src/account/views.py +++ b/src/account/views.py @@ -128,6 +128,11 @@ class JiraLoginView(RedirectView): return url +class OIDCLoginView(RedirectView): + def get_redirect_url(self, *args, **kwargs): + return reverse('oidc_authentication_init') + + class JiraLogoutView(LoginRequiredMixin, RedirectView): def get_redirect_url(self, *args, **kwargs): logout(self.request) @@ -204,7 +209,7 @@ class UserListView(TemplateView): template_name = "account/user_list.html" def get_context_data(self, **kwargs): - users = User.objects.all() + users = UserProfile.objects.filter(public_user=True).select_related('user') context = super(UserListView, self).get_context_data(**kwargs) context.update({'title': "Dashboard Users", 'users': users}) return context |