#1574 Can't set FAS account to vacation
Closed: Fixed None Opened 14 years ago by julian.

Although the FAS frontend offers it, I can't set my FAS account to vacation. If I do, it tells me:
status: Value must be one of: active; inactive; expired; admin_disabled (not u'vacation')


Thanks for reporting this bug. For now, make sure to add yourself to http://fedoraproject.org/wiki/Vacation so that people know you're vacationing.

I'm not 100% sure what the correct fix for this is - it would be either adding it to the database constraints and validation to make it a valid status, or it'd be removing it from the list of valid statuses all together (especially as there may be a lot of code that only checks for status='active').

CCing Toshio and Mike so we can discuss what to do with the status.

we should allow it as a status I think.

I think we want to go with removing the vacation status, at least for now. I have a dread that there's lots of code (both ours and third party) that does this:

{{{
if people.status == 'active':
# Do action
}}}

With a vacation status, chances are very good that we'd want to still perform the action there (sending broken dep reports to maintainers, having an @fedoraproject.org email alias, etc). So all that code would need to be audited and the logic changed. We can consider adding back in a vacation code if we decide to do a major API-breaking fas release.

{{{
diff --git a/fas/user.py b/fas/user.py
index 737d995..f712be8 100644
--- a/fas/user.py
+++ b/fas/user.py
@@ -261,7 +261,7 @@ class User(controllers.Controller):
validators.Regex(regex='^[^\n:<>]+$'),
),
'status' : validators.OneOf(['active', 'inactive', 'expired',
- 'admin_disabled']),
+ 'admin_disabled', 'vacation']),
'ssh_key' : ValidSSHKey(max=5000),
'email' : validators.All(
validators.Email(not_empty=True, strip=True, max=128),

}}}

Please ignore the previously submitted patch. I didn't refresh the ticket.

The fas.pot patch is a little "odd" because it contains a patch from another ticket.

Here are the removal patches:

{{{
diff --git a/fas/help.py b/fas/help.py
index 0d2604d..a734b8e 100644
--- a/fas/help.py
+++ b/fas/help.py
@@ -33,7 +33,7 @@ class Help(controllers.Controller):
'user_postal_address': [('Postal Address'), ('

This should be a mailing address where you can be contacted. See our http://fedoraproject.org/wiki/Legal/PrivacyPolicy">Privacy Policy about any concerns.

')],
'user_timezone': [('Timezone (Optional)'), ('

Please specify the time zone you are in.

')],
'user_comments': [('Comments (Optional)'), ('

Misc comments about yourself.

')],
- 'user_account_status': [('Account Status'), ('

Shows account status, possible values include

  • active
  • vacation
  • inactive

')],
+ 'user_account_status': [('Account Status'), ('

Shows account status, possible values include

  • active
  • inactive

')],
'user_cla' : [('FPCA'), ('

In order to become a full Fedora contributor you must complete the http://fedoraproject.org/wiki/Legal:Fedora_Project_Contributor_Agreement">Fedora Project Contributor Agreement. This license is a legal agreement between you and Red Hat. Full status allows people to contribute content and code and is recommended for anyone interested in getting involved in the Fedora Project.

')],
'user_ssh_key' : [('Public RSA SSH Key'), ('

Many resources require public key authentiaction to work. By uploading your public key to us, you can then log in to our servers. Type "man ssh-keygen" for more information on creating your key (it must be an RSA key). Once created you will want to upload ~/.ssh/id_rsa.pub

')],
'user_locale': [('Locale'), ('

For non-english speaking peoples this allows individuals to select which locale they are in.

')],
}}}

{{{
diff --git a/fas/templates/user/view.html b/fas/templates/user/view.html
index 9491324..22d3346 100644
--- a/fas/templates/user/view.html
+++ b/fas/templates/user/view.html
@@ -79,7 +79,6 @@



${('Active')}
- ${
('Vacation')}
${('Inactive')}
${
('Pinged')}
${_('Disabled')}
}}}

{{{
diff --git a/po/fas.pot b/po/fas.pot
index db4dc2a..805cf2a 100644
--- a/po/fas.pot
+++ b/po/fas.pot
@@ -615,7 +615,7 @@ msgstr ""
#: fas/help.py:36
msgid ""
"

Shows account status, possible values "
-"include

  • active
  • vacation
  • inactive

"
+"include
  • active
  • inactive

"
msgstr ""

#: fas/help.py:37
@@ -1357,8 +1357,9 @@ msgstr ""
#: fas/validators.py:198
#, python-format
msgid ""
-"'%(username)s' is an illegal username. A valid username must only "
-"contain lowercase alphanumeric characters, and must start with a letter."
+"'%(username)s' is an illegal username. A valid username must be ASCII, "
+"only contain lowercase alphanumeric characters, and must start with a "
+"letter."
msgstr ""

#: fas/validators.py:201
@@ -2394,10 +2395,6 @@ msgstr ""
msgid "Active"
msgstr ""

-#: fas/templates/user/view.html:82
-msgid "Vacation"
-msgstr ""
-
#: fas/templates/user/view.html:83
msgid "Inactive"
msgstr ""
}}}

{{{
diff --git a/fas/templates/user/edit.html b/fas/templates/user/edit.html
index 71275fb..c8738e8 100644
--- a/fas/templates/user/edit.html
+++ b/fas/templates/user/edit.html
@@ -123,7 +123,7 @@ Unfortunately, checked can't be used as a boolean, only as a flag. Silly HTML4


<label for="status">${_('Status')}:</label>
<select id="status" name="status">
- <option py:for="status in ('active', 'vacation', 'inactive')" value="${status}" py:attrs="{'selected': target.status == status and 'selected' or None}">${status}</option>
+ <option py:for="status in ('active', 'inactive')" value="${status}" py:attrs="{'selected': target.status == status and 'selected' or None}">${status}</option>
<option py:if="admin" value="admin_disabled" py:attrs="{'selected': target.status == 'admin_disabled' and 'selected' or None}">disabled</option>
</select>
<script type="text/javascript">var hb7 = new HelpBalloon({dataURL: '${tg.url('/help/get_help/user_account_status')}'});</script>
}}}

Login to comment on this ticket.

Metadata