Skip to content

Commit

Permalink
Hide the password change section for github accoutns
Browse files Browse the repository at this point in the history
  • Loading branch information
Lobosque committed Oct 16, 2017
1 parent 7794560 commit 88df73f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions humans/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ class User(AbstractUser):
timezone = TimeZoneField(default='UTC', verbose_name=_('Timezone'))
language = models.CharField(default="en-us", max_length=16, choices=LANGUAGE_CHOICES , verbose_name=_('Language'))



def has_setup_complete(self):
if self.public_key and self.fingerprint:
return True
return False

@property
def has_github_login(self):
return self.socialaccount_set.filter(provider='github').count() >= 1

@property
def has_public_key(self):
return True if self.public_key else False
Expand Down
2 changes: 2 additions & 0 deletions humans/templates/humans/update_user_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<div class="col-xs-12 nav-st no-padding text-left">
<li id="tab1" class="sett__nav__item text-darkest active">{% trans "Profile" %}</li>
<li id="tab2" class="sett__nav__item text-darkest">{% trans "Keys" %}</li>
{% if not form.instance.has_github_login %}
<li id="tab3" class="sett__nav__item text-darkest">{% trans "Password" %}</li>
{%endif %}
<li id="tab4" class="sett__nav__item text-darkest">{% trans "Experimental Features" %}</li>
</div>
</ul>
Expand Down

0 comments on commit 88df73f

Please sign in to comment.