# ValidatePrefs not working?

**URL:** <https://forums.plex.tv/t/validateprefs-not-working/116117>\
**Category:** Dev/API Corner\
**Tags:** scanner-agent-dev\
**Created:** [September 18, 2015, 7:53am UTC](https://forums.plex.tv/t/validateprefs-not-working/116117 "2015-09-18T07:53:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirotin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/amirotin/32/7298_2.png) [@amirotin](https://forums.plex.tv/u/amirotin)\
**Post date:** [September 18, 2015, 7:53am UTC](https://forums.plex.tv/t/validateprefs-not-working/116117/1 "2015-09-18T07:53:10Z")

</div>

Greetings. How can i validate Prefs after saving and promt user to correct if something wrong (wrong login|password).

This code doen’t work (nothing is shown):

```
def ValidatePrefs():
  return MessageContainer('Error', 'Something wrong!')

```

All what i get in log:

> 2015-09-17 16:39:23,739 (de8) : DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.agents.kinopoisk/prefs/set  
> 2015-09-17 16:39:23,742 (de8) : DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.agents.kinopoisk/prefs/set  
> 2015-09-17 16:39:23,750 (de8) : DEBUG (preferences:198) - Saved the user preferences  
> 2015-09-17 16:39:23,763 (de8) : DEBUG (runtime:918) - Response: [200] MessageContainer, 100 bytes

---

<div class="post-metadata">

**Author:** ![amirotin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/amirotin/32/7298_2.png) [@amirotin](https://forums.plex.tv/u/amirotin)\
**Post date:** [September 18, 2015, 9:40am UTC](https://forums.plex.tv/t/validateprefs-not-working/116117/2 "2015-09-18T09:40:19Z")

</div>

ObjectContainer also doesn’t show any messages

---

<div class="post-metadata">

**Author:** ![ZeroQI](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/zeroqi/32/6522_2.png) [@ZeroQI](https://forums.plex.tv/u/ZeroQI)\
**Post date:** [September 13, 2016, 11:33pm UTC](https://forums.plex.tv/t/validateprefs-not-working/116117/3 "2016-09-13T23:33:16Z")

</div>

ValidatePrefs()  
This function is called when the user modifies their preferences. The developer can check the newly provided values to ensure they are correct (e.g. attempting a login to validate a username and password), and optionally return a MessageContainer to display any error information to the user.

Source: /uploads/default/original/3X/c/4/c474c361f240cf9ffd7330481c995a38c7d32a5b.pdf

Doesn’t behave as per framework documentation. I have the following installed:

- Synology DS1815+ NAS running Plex server app “PlexMediaServer-1.1.4.2757-24ffd60-x86.spk”
- Plex Web Version 2.8.1
- Plex Server Version 1.1.4.2757
- Accessed from running on Windows 10 pro x64

I need it to be working for my Hama agent, as i use agent data folders and if installed with Unsupported Appstore v2, i need to be able to bring a popup with this validation “def ValidatePrefs():” function but while it ran, no popup was shown… So same boat and issue persists…

---

<div class="post-metadata">

**Author:** ![ZeroQI](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/zeroqi/32/6522_2.png) [@ZeroQI](https://forums.plex.tv/u/ZeroQI)\
**Post date:** [October 5, 2016, 3:09am UTC](https://forums.plex.tv/t/validateprefs-not-working/116117/4 "2016-10-05T03:09:27Z")

</div>

Would love to have an update… Need the popup for my agent…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 7:51pm UTC](https://forums.plex.tv/t/validateprefs-not-working/116117/5 "2020-01-08T19:51:27Z")

</div>


